On Sat, 2002-08-17 at 19:49, John Coder wrote:
> This may or may not work but what the h***. If you have multiple insets
> commands test for ! isnull() on each input field ,i.e. variable.
> if (! isnull($input_field))
> then "insert_query"
> as I said this will only work with an insert query for each field.
I see how that would work with individual insert querys for individual
fields, but in my case there are four input fields per query, so it
won't work, even then it is possible for one field to be left empty in
each query (the comments field). And that is okay. If I try this -
if (!isnull($date_am || $exercise_am || $reps_am)) then
mysql_query($sql_am) or die
("Error in this query >>$sql<< : " .mysql_error());
I get this error -
Parse error: parse error, unexpected T_STRING in
/usr/local/apache/htdocs/workout-abs.php on line 111
I have 4 fields, 3 will always be filled, 1 is optional. I thought I
would try to test for any of the 3 being empty but it didn't work.
> On Sat, 2002-08-17 at 17:08, Chip Wiegand wrote:
> > I have a web page interface to a mysql database. In this web page I have
> > about a dozen form input fields. On submit these are submitted to
> > multiple tables, a differant table for each input field. If I leave any
> > fields blank, and insert only some of the fields, the database will
> > insert an empty row to all the effected tables that didn't have any data
> > from the input fields.
> > I have another page that generates graphs from the tables, the empty
> > rows show up as breaks in the graphs lines, if I manually delete all the
> > empty rows the graphs work fine.
> > What do I need to do to prevent these empty rows from being written to
> > the tables?
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php