Hi,
The problem. I want to select all the data in my msql database which has a specific id. e.g. I have three primary ids ‘cell1’, ‘cell2’ and ‘cell3’ etc. okay so you get the idea.
Now I want to select all the data the has a primary id of say ‘cell2’ and spit it back.
I have got this working, but only when the primary key is a number and not when it is a combinantion of letters and numbers or just letters.
This is the php code I am using. The field in the mySql Database is of the varChar type so this shouldn’t be the problem, should it?
PHP CODE:
$phpvar1 = $_GET[“scell”];
$query = “SELECT * FROM tableName WHERE filePath = $phpvar1”;
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
while($row = mysql_fetch_array($result))
{
$filepath = $row[1];
$data .= $filepath;
$data .= "//";
}
echo “info=$data”;
The error I get when the primary ID has any letters in it is
“Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/devinchcom/public_html/flashupload/selectData.php on line **13”
**
Any help would be great.
Thanks!
DC