[thelist] Null entry in form

Santilal Parbhu santilal at scorpioneng.co.nz
Wed Apr 25 07:06:13 CDT 2007

Actually what I had was :

foreach($HTTP_POST_VARS['match_id'] as $id){
		print "Here are the values: Score1 = $score1, and Score2 =$score2";
		if ((!is_null($score1)) and (!is_null($score2))) {	 //This line added
25/04/07 to skip code below if entry is null.

	$query = "UPDATE $compdraw SET score1=('$score1'), score2=('$score2')
					WHERE row_id = '$id'  AND grade='$grd'";

		if($r = mysql_query ($query)){ // Execute the query.
		}else{ // Query didn't run.
					print '<div id="draw">';
					die ('<p>Could not retrieve the data because: <b>' . mysql_error() .
"</b>. The query was $query.</p>");

Perhaps my logic is wrong. What I was hoping to do was skip the update only
if both score1 and score2 were null.  At any rate I was testing it by using
score1 = NULL and score2 = NULL, and it still didn't work.

Is !is_null a valid operator?

Thanks again.


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Lee Kowalkowski
Sent: Wednesday, 25 April 2007 11:05 p.m.
To: thelist at lists.evolt.org
Subject: Re: [thelist] Null entry in form

> isset would be true, as $score1 would be *set* to *null*, use isnull.

...which has an underscore in it somewhere between "is" and "null".


* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !

More information about the thelist mailing list