i need a very small help:)
Posted: Wed Sep 20, 2006 2:49 pm
i just want to print on a page something that is found in my database, i used
<?php
define("LOG_USERNAME","root");
define("LOG_PASSWORD","vertrigo");
define("DBname","sql_tables");
mysql_connect("localhost","root","vertrigo");
mysql_select_db(DBname);
$query = "SELECT UserName, CustID, Email FROM customer WHERE UserName=a";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name :{$row['UserName']} <br>" .
"Subject : {$row['CustID']} <br>" .
"Message : {$row['Email']} <br><br>";
}
?>
and its not working , who can help me fixing it ? (seems its not understanding the "mysql_fetch_array" and i dont know php to fix it .. i just want to pring this:s anyone can help?[/size]
the error is : mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:/vertrigoserv/www/test.php on line 16
<?php
define("LOG_USERNAME","root");
define("LOG_PASSWORD","vertrigo");
define("DBname","sql_tables");
mysql_connect("localhost","root","vertrigo");
mysql_select_db(DBname);
$query = "SELECT UserName, CustID, Email FROM customer WHERE UserName=a";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name :{$row['UserName']} <br>" .
"Subject : {$row['CustID']} <br>" .
"Message : {$row['Email']} <br><br>";
}
?>
and its not working , who can help me fixing it ? (seems its not understanding the "mysql_fetch_array" and i dont know php to fix it .. i just want to pring this:s anyone can help?[/size]
the error is : mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:/vertrigoserv/www/test.php on line 16