Hi,
We try to build up web-based database via PHP4.0 and mysql.
Our code is like:
$query = " select * from tablename where name='$name' ";
$result = safe_query($query, $link);
if (mysql_num_rows ($result) == 0)
{
echo ("sorry, no results found.");
}
else {
echo("Name: $Name");
echo("Address: $Address");
}
But We got " no results found "or just got "Name: and Address. " No "$Name" and "$Address " displayed.
It seems that my php is hard to recongized or read variables ($).
No any connection failed and database selected failed. Do you know what is reason? My code is not right or some other reasons?
THanks a lot,
HR
We try to build up web-based database via PHP4.0 and mysql.
Our code is like:
$query = " select * from tablename where name='$name' ";
$result = safe_query($query, $link);
if (mysql_num_rows ($result) == 0)
{
echo ("sorry, no results found.");
}
else {
echo("Name: $Name");
echo("Address: $Address");
}
But We got " no results found "or just got "Name: and Address. " No "$Name" and "$Address " displayed.
It seems that my php is hard to recongized or read variables ($).
No any connection failed and database selected failed. Do you know what is reason? My code is not right or some other reasons?
THanks a lot,
HR