XAMPP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP

Postby albie » 10. September 2005 14:00

Hi

I have a problem with XMAPP, I can’t access the database from html/php. I’ve installed it and use UltraEdit-32. The installation works ok but when I try to access my database from the html and php it writes an error message (see below) My OS is XP on a Dell 1.7 Precision 340 with 1.2G Ram. It was running Win2000 until I updated it to XP. It works on the separate installation of IndigoPerl and MySQL 4.0.12-WIN.ZIP at college but unfortunately I can’t seem to get it to install at home, hence opting for XMAPP.
This is why I have been trying to make XAMPP work.
The error message I get when I try to install the mysql-4.0.12-win.zip NTVDM “KERNEL: Missing 14-bit system module
Please re-install the following module to your system32 directory: SOUND.DRV”
I’ve experienced this error message if compatibility issues arise.
Could anyone, if possible tell me or direct me to the correct issue of my dilemma and fix this problem.
I am studying for dynamic html at college and have only a few months to fix this problem. The code below was written by our teacher and it works fine at college with the separate installation of indigoperl and mysql but not xmapp.
I wrote in a database in phpmyadmin, so it should work.. I don’t know enough about phpmyadmin to fix the problem
Thank you in anticipation.
Albie
ps if u require any additional info please send it to my email
amz@homemail.com.au

1. html code.

<html>
<head>
<title> Books R Us</title>
</head>
<body>
<h1>Books R Us – Category Search</h1>
<form action = “sss06_eg1.php” method = “GET”>
Choose Search Type:
<br>
<select name= “searchtype”>
<option value= “isbn”>isbn</option>
<option value= “title”>title</option>
<option value= “author”>author</option>
<option value= “price”>price</option>
</select>
<br><br>
Enter Search Text:
<input type= “text” name= “searchtext” id= “searchtext”><br><br>
<input type= “submit” “value= “Search”>
</form>
</body>
</html>

2. PHP code.

<html>
<head>
<title>Books R Us</title>
</head>
<body>
<h1>Books R Us – Search Results</h1>
<?php
$searchtype = $_GET['searchtype'];
$searchtext = $_GET['searchtext'];
$searchtext = trim($searchtext);

//double check input fields
if (!searchtype || !searchtext)
{
echo "You must enter search details. Please retry.";
exit;
}
if (!get_magic_quotes_gpc())
$searchtext = addslashes($searchtext);
//open the database connection
$conn = mysql_connect("localhost");

//select the database
mysql_select_db("books r us", $conn);

//read through the books and write out info
$sql = "SELECT * FROM books WHERE $searchtype LIKE '%$searchtext%' ";
$result = mysql_query($sql, $conn) or die("Error inserting record - ".mysql_error());
echo "<table border=1>";
echo "<tr><td>isbn</td><td>title</td><td>author</td><td>price</td></tr>";

while ($line_array = mysql_fetch_array($result))
{
echo "<tr>";

echo "<td>$line_array[0]</td>";
echo "<td>$line_array[1]</td>";
echo "<td>$line_array[2]</td>";
echo "<td>$line_array[3]</td>";
echo "</tr>";
}

?></table>
</body>
</html>

3. This is the error message I get in the php code. The code is ok with the separate indigoperl, mysql installation but not XAMPP.

Books R Us – Search Results
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Program Files\xampp\htdocs\sss06_eg1.php on line 21

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\xampp\htdocs\sss06_eg1.php on line 24

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\xampp\htdocs\sss06_eg1.php on line 28
Error inserting record - Access denied for user 'ODBC'@'localhost' (using password: NO)
albie
 
Posts: 1
Joined: 10. September 2005 13:47

Postby Wiedmann » 10. September 2005 14:09

Code: Select all
$conn = mysql_connect("localhost");

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Program Files\xampp\htdocs\sss06_eg1.php on line 21

You should read the PHP-Manual how to use this function.
--> you miss the parameters for user and password
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 143 guests