Hi,
First mysql_fetch_row() returns an array so it doesn't make much sense to 
compare it to 5. If you want to check tne number of records the query has 
returned you should use mysql_num_rows() - like this

if(mysql_num_rows($result)>=5){ }

or if you want to check the value returned by the query something like this 
should work though I would personally add some additional error testing.

if(mysql_result($result,0,0)>=5){ }

HTH
-- 
Dobromir Velev
[EMAIL PROTECTED]
http://www.websitepulse.com/


On Wednesday 25 August 2004 18:02, Stuart Felenstein wrote:
> Thought earlier that I could get by on just plain SQL.
>
> Php needed.  I'm getting a parse error on the "if"
> line.
> This is supposed to be a trigger then before
> transaction counts the number of rows , id already
> inserted, if exceeded , kick back error message , halt
> transaction.
> Not sure where I need to go with this statement to
> make it work. Ideas , help, suggestions welcome!
>
> //start trigger Trigger1
> function KT_TriggerSTARTER_Trigger1(&$tNG) {
> $result = mysql_query("SELECT LurkTitleTim.LurkID
> WHERE
> LurkID='$new_input'");
>
> if ($row=mysql_fetch_row($result) >= 5) {  error- data
> already exists   }
>
>     else { go ahead and add data with INSERT statement
> }
> }
>
> Thank you ,
> Stuart



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to