HormonX
11-21-2002, 12:56 AM
am not sure what am doing wrong ...
am trying to get results after user input but i only need one row so i did this;
//this is my connection script that i use on all my pages
include('connect.php');
//this is my query
$query = "SELECT name FROM mytable where value='$uservalue'";
//this where i do query $link is within connect.php
$result = mysql_query($query, $link)
while($r = mysql_fetch_row($result))
{
hello my name is: $r[0]
}
i have also tried this :
//this is my connection script that i use on all my pages
include('connect.php');
//this is my query
$query = "SELECT * FROM mytable where value='$uservalue'";
//this where i do query $link is within connect.php
$result = mysql_query($query, $link)
while($r = mysql_fetch_row($result))
{
$name = $r['name'];
hello my name is: $name
}
And in both time i get this error....
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/domain/public_html/myfile.php on line 103
Please help me... :)
HormonX
am trying to get results after user input but i only need one row so i did this;
//this is my connection script that i use on all my pages
include('connect.php');
//this is my query
$query = "SELECT name FROM mytable where value='$uservalue'";
//this where i do query $link is within connect.php
$result = mysql_query($query, $link)
while($r = mysql_fetch_row($result))
{
hello my name is: $r[0]
}
i have also tried this :
//this is my connection script that i use on all my pages
include('connect.php');
//this is my query
$query = "SELECT * FROM mytable where value='$uservalue'";
//this where i do query $link is within connect.php
$result = mysql_query($query, $link)
while($r = mysql_fetch_row($result))
{
$name = $r['name'];
hello my name is: $name
}
And in both time i get this error....
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/domain/public_html/myfile.php on line 103
Please help me... :)
HormonX