View Single Post
  #4 (permalink)  
Old 04-21-06, 03:29 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
The most immediate problem with this is that there is a mismatch of quotes near the end of the $request string...

This string is overly complex and can be simplified because variables are parsed inside double-quoted strings. The following will work and make the above type of error easier to avoid and easier to find -
PHP Code:

$request "INSERT INTO orders VALUES (now(), '$orderName', '$orderAdd', '$orderAdd2', '$orderCity', '$orderState', '$orderCountry', '$orderZip', '$orderEmail', '$orderCartCookie')"
[So that no one askes about the spaces after the coma's in the above that are not in the original, they are only to keep the PHP code post wrapping function from inserting its' own space somewhere in the string.]

The next problem that will prevent this code from working is that the functions used within the mysql_safe function are not used properly. All of these functions return a string and need to be assigned to a variable. Additionally, the addslashes() function is missing a parameter. Finally, the mysql_safe function must return a value, which it does not do...
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???

Last edited by mab; 04-21-06 at 03:35 PM.
Reply With Quote