[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-win32
Subject:    Re: Question about Insert Statement
From:       Tata Respecia <tatarespecia () yahoo ! com>
Date:       2004-07-24 3:04:40
Message-ID: 20040724030440.30661.qmail () web60807 ! mail ! yahoo ! com
[Download RAW message or body]


use \"$leaName\" instead and the rest of variables

Danny Willis <danny.willis@project-wildfire.com> wrote: My question/problem I am \
having is that there may be cases where I do not have all the fields full. From my \
experimentation and interpretation of the documentation if the fields are full and I \
end up with a query looking like this:
INSERT INTO $db_s_leagues (leaName, leaEmail, leaOwner, Address, City,
State, Zip, DateStarted) 
VALUES('$leaName','','$leaOwner','$leaAddress','$leaCity','$leaState',$leaZi
p,)

The query fails due to the "''" and the ",)"

Is there a way to work around this issue so I don't have to code up some
funky error checking in my php code to check and adjust for any empty data?

Here is the query I am working with:

INSERT INTO $db_s_leagues (leaName, leaEmail, leaOwner, Address, City,
State, Zip, DateStarted) 
VALUES('$leaName','$leaEmail','$leaOwner','$leaAddress','$leaCity','$leaStat
e',$leaZip,$leaDateStarted)

Thanks,
Dan 


-- 
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=tatarespecia@yahoo.com




		
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic