RE: [PHP-DB] Check data exists in MySQL

2002-11-21 Thread Adam Royle
Sorry about previous post (some stupid shortcut key made it send) Your row: $sql = "INSERT INTO count VALUES('$dept', '$deptsub', '0'); should be: $sql = "INSERT INTO count VALUES('$dept', '$deptsub', '0')"; You missed the double quotes. Adam --- Original Message --- Hi, for some reason

Re: [PHP-DB] Check data exists in MySQL

2002-11-20 Thread Tatang Widyanto
$sql="SELECT num FROM count where dept='$dept' AND deptsub='$deptsub'"; begin of replace -- $result = mysql_query($sql,$db); $page_count = mysql_num_rows($result); # If does not exist in the database, insert a new entry if (!$page_

RE: [PHP-DB] Check data exists in MySQL

2002-11-20 Thread Gavin Amm
'm getting the following error message: Parse error: parse error in /home/./public_html/public/index.php on line 25 (Which is the line: $sql="UPDATE count...) Any thoughts would b most helpful. Thanks, Gav -Original Message----- From: Tatang Widyanto [mailto:[EMAIL PROTE

Re: [PHP-DB] Check data exists in MySQL

2002-11-20 Thread Tatang Widyanto
> if (!$page_count){ > $sql = "INSERT INTO count VALUES('$var1', '$var2', '0'); > } > > if (!mysql_num_rows($page_count)){ > $sql = "INSERT INTO count VALUES('$var1', '$var2', '0'); > } > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php