Jump to content

[SOLVED] mysql_numrows problem (I think)


Krunk

Recommended Posts

Good day all,

I have an update.php script that is not working.

I think the problem is the query string and the mysql_numrow function

below.

My other scripts of output and insert work fine. In vi, all color

syntax matches except for the mysql_numrows function. It is

white where the other functions are normal lite blue.

When I take the single quotes out from '$id' the colors match and

mysql_numrows() becomes lite blue but the script still does not

work and it needs those quote. I get a blank update.php page in the browser.

I would like to post the entire script but the rules say

no php variables.

Has anyone had this situation before. Thanks in advance.

 

 

mysql_connect("192.168.2.6",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts WHERE id='$id'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();

 

Link to comment
https://forums.phpfreaks.com/topic/55850-solved-mysql_numrows-problem-i-think/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.