You are here: Re: hm??? integer converting? « PHP Language « IT news, forums, messages
Re: hm??? integer converting?

Posted by roN @ work on 07/08/05 12:25

roN @ work wrote:
> Hi,
> I got following Code and get Below Error, why? :(
> [Code]
> function reportSpam($email_address_and_relay)
> {
> $connection=mysql_connect(db_server,db_user,db_passwort);
> mysql_select_db(db_name);
>
> $date = date("y-m-d");
> $tmp=explode("*",$email_address_and_relay);
> $address = $tmp[0];
> $relay = $tmp[1];
> $query = "insert into blacklist (`Date`,`Address`, `Relay`) values
> ('$date','$address', $relay)";
>
> mysql_query($query) or die(mysql_error());
> mysql_close($connection);
> echo "reported ".$email_address."<br>\n";
> }
> [/Code]
> [Error]
> You have an error in your SQL syntax. Check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near '.160.97)' at line 2
> [/Error]
> In Variable $email_address_and_relay there is something like
> test@example.com*255.127.53.49 I'd like to explode that and save the
> e-mail address and the relay IP in diffrent cols in the same row.
> shouldn't it work? :(
> table blacklist looks like this:
> Date - date
> Address - varchar(100)
> Relay - varchar(50)
> do I have to convert $relay to an integer before I'm gonna save it to
> the DB? Yes? How?

Sorry, I meant convert it to a String for sure....

--
chEErs roN
I'm root. I'm allowed to do this! ;)
keep on rockin'

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация