Re: [PHP-DB] Please help a newbie: Fixed

[email protected] (Rij)
Newsgroups php.db
Message-ID <[email protected]>
Ok, figured it out.
I was using an int for the field but the value was too large for it. I
used bigint instead and life is suddenly so much better. Well it helps
that its bright and sunny here too :)

On Sun, Apr 19, 2009 at 10:37 AM, mrfroasty <[email protected]> wrote:
> Try using var_export() or var_dump() to debug to see why that 1st time is
> having different values than what you want.... :-)
> The idea from the sample code I have provided is not to use phone as id...
>
> P:S
> A wild guess would phone is some sort of string.....
>
> GR
> mrfroasty
>
>
>
> Rij wrote:
>>
>> Ok. But that still doesn't tell me why I am getting the behavior from
>> my code. Where is the garbage value coming from? And why only the
>> first time I do an INSERT?
>>
>> To Daniel Carrera, thanks for your tip. I sure will look up your
>> suggestion.
>>
>> On Sun, Apr 19, 2009 at 2:32 AM, mrfroasty <[email protected]> wrote:
>>
>>>
>>> Hello,
>>>
>>> May be try something like this:
>>>
>>> $query1=
>>> CREATE TABLE contacts(
>>> id int(16) NOT NULL auto_increment,
>>> phone varchar(15)  NOT NULL,
>>> name varchar(15) NOT NULL,
>>> address varchar(15) NOT NULL,
>>> PRIMARY KEY (id)
>>> );
>>>
>>> $query2 = "INSERT INTO contacts VALUES ('NULL','$phone', '$name',
>>> '$address')";
>>>
>>> P:S
>>> id incremented automatically by MYSQL now
>>>
>>> GR
>>> mrfroasty
>>>
>>>
>>>
>>>
>>
>>
>
>
> --
> Extra details:
> OSS:Gentoo Linux-2.6.25-r8
> profile:x86
> Hardware:msi geforce 8600GT asus p5k-se
> location:/home/muhsin
> language(s):C/C++,VB,VHDL,bash,PHP,SQL,HTML,CSS
> Typo:40WPM
> url:http://mambo-tech.net
> url:http://blog.mambo-tech.net
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.