Hi,
You need to encapsulate your data in quotes. I would have done it
like this with double quotes, single quote passed to query.
$query = "INSERT INTO Players (fname, lname, address, city, state,
zip, phhome, phcell, phwork, other, email)";
$query .="VALUES (';
$query .=" '".$_POST['fname']."', '".$_POST['lname']."', '".$_POST
['address']."',";
$query .=" '".$_POST['city']."', '".$_POST['state']."', '".$_POST
['zip']."',";
$query .=' '".$_POST['phhome']."', '".$_POST['phcell']."',";
$query .=" '".$_POST['phwork']."', '".$_POST['other']."', '".$_POST
['email']."' ";
$query .=" )";
Sincerely,
Mike
--
Mike Brandonisio * Web Hosting
Tech One Illustration * Internet Marketing
tel (630) 759-9283 * e-Commerce
[EMAIL PROTECTED] * http://www.jikometrix.net
JIKOmetrix - Reliable web hosting
On Jul 3, 2006, at 6:24 PM, Wade Smart wrote:
> 07032006 1818 GMT-6
>
> I have this insert statement that Im working with and Im getting an
> error that says...
>
> "You have an error in you SQL syntax near 'Revere Street'.
> That is the address. Oddly, it took off the numbers of the street.
> Is inserting into a varchar thats 20 in size, more than enough.
>
> $query = 'INSERT INTO Players (fname, lname, address, city, state,
> zip, phhome, phcell, phwork, other, email)';
> $query .='VALUES (';$query .=' '.$_POST['fname'].', '.$_POST
> ['lname'].', '.$_POST['address'].',';
> $query .=' '.$_POST['city'].', '.$_POST['state'].', '.$_POST
> ['zip'].',';
> $query .=' '.$_POST['phhome'].', '.$_POST['phcell'].',';
> $query .=' '.$_POST['phwork'].', '.$_POST['other'].', '.$_POST
> ['email'].' ';
> $query .=' )';
>
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------
> ~-->
> See what's inside the new Yahoo! Groups email.
> http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/HKFolB/TM
> --------------------------------------------------------------------
> ~->
>
> Community email addresses:
> Post message: [email protected]
> Subscribe: [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
> List owner: [EMAIL PROTECTED]
>
> Shortcut URL to this page:
> http://groups.yahoo.com/group/php-list
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Great things are happening at Yahoo! Groups. See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/HKFolB/TM
--------------------------------------------------------------------~->
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/