which syntax is correct:
if (empty ($_POST['var'])) {
or
if (!empty ($_POST['var'])) {
and if both are correct, what determines the use of the leading !
thanks
amy
thanks for all the additional tips. I agree about cleaning up user data before it gets to the db and will take that on soon.
the mysql_query(insert.....) syntax i found online and it is working but i'll work on getting up to date with all the code.
?? the mysql_connect.php script contains the...
you rock, aardvark!
that error message display was just the trick to show me the solution.
contact table pk was duplicating. i made it an autoincrement and then added the value NULL to the insert query.
voila!
thanks to all you teks for your tips - you are great.
Cheerio!
amy
thanks Jet, but I have tried exactly what you suggest with no success.
now i have a completely broken script that does nothing.
this is the last iteration i have tried, with no success:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
ps - does it make sense that for every table i should have a separate form with its own submit button?
maybe that is the trouble with my script - there is only one form with many fields, that ultimately are headed for one of five different tables in the db.
thanks
I am searching for codes examples that show how to use PHP with MySql to send form data into more than one table.
i can send form data into one table only,
no matter how i try, no data will go into the second table.
the sequence that works for data into a single table is:
1. set variables -...
thanks, i will move to the PHP forum as suggested.
and,
i have lots of books, i wish i could find just one freaking example of this in a book or on line somewhere.
it's not for lack of trying, trust me.
byby
I can get the closing echo statements to print with this revision, but still cannot get entries into the second table
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>...
I can get an entry into the first table.(company)
i managed to get one entry into the second table (contact), one time - and then it stopped working when i itried to add a second field in the second table,
must be another of those dreaded 'typos'.
a well, this code does not print the echo...
Hi Rac2,
ok i think you might have nailed the problem on the head.
my working model uses:
$result=mysql_query($query)
followed by
if ($result) echo "some stuff";
else "echo some other stuff";
so, to follow your point, it seems I need to have my if ($result).... OR, your $mysql_query
and I...
well, no, it does NOT look like that!
your red-letter insertions are what i don't have.
are they to separate the insert calls?
are the ... required also, or just shorthand for 'more like this'?
thanks
my db has multiple tables with an online form that captures data to go into one or more of these tables.
i have total success with a single table db - from user entered data to mysql db record - perfecct.
now i am testing the new multi-table db using just two of the tables, and i know the...
I realized all of what you are saying halfway through writing my last post. More to the point, I understood that I could go no further without analyzing and establishing the table structure.
I've got a terminal case of hurry up and want it now disease but I do try hard to find my answers in the...
Thanks for the reply. I read thru the link you sent.
Is my alternative to create individual columns for each variable?
In this instance I want the user to be able to select more than one option and the database should hold it all.
i am answering my own question as I write this - yes, of...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.