List:MySQL on Win32« Previous MessageNext Message »
From:Tata Respecia Date:July 24 2004 5:04am
Subject:Re: Question about Insert Statement
View as plain text  
use \"$leaName\" instead and the rest of variables

Danny Willis <danny.willis@stripped> 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=1




		
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
Thread
Using a Blob with the ByteFX data providerNick Randell16 Jul
  • RE: Using a Blob with the ByteFX data providerReggie Burnett19 Jul
    • RE: Using a Blob with the ByteFX data providerNick Randell20 Jul
      • Suggested settings for dual processor machine?East Bay Technologies20 Jul
      • RE: Using a Blob with the ByteFX data providerReggie Burnett20 Jul
      • Should I use myISAM or InnoDB??East Bay Technologies21 Jul
      • Should I use myISAM or InnoDB??East Bay Technologies23 Jul
      • Suggested settings for dual processor machine?East Bay Technologies23 Jul
RE: Should I use myISAM or InnoDB??PF: MySQL23 Jul
  • Question about Insert StatementDanny Willis23 Jul
    • Re: Question about Insert StatementTata Respecia24 Jul
      • Ignoring or filtering ' charCadbury30 Jul
        • Strange site error.Danny Willis30 Jul
        • Re: Ignoring or filtering ' charTiago Serafim30 Jul
          • Re: Ignoring or filtering ' charCadbury4 Aug
            • Re: Ignoring or filtering ' charTiago Serafim4 Aug
              • Re: Ignoring or filtering ' charCadbury5 Aug
        • Re: Ignoring or filtering ' charPetr Vileta30 Jul
          • Re: Ignoring or filtering ' charTiago Serafim30 Jul
Re: Question about Insert StatementRandy Clamons24 Jul