Inserting concatenated data into DB, difficult 1
Sorry, had to change the title of the thread :)
PHP Code:
$i = 1 ;
while ($i <= 3) {
print $i; //just to check
$result = mysql_query("INSERT INTO nbalive_daybyday (GP, Nickname, PTS, FGM, FGA) VALUES ('$GP$i' , '$Nickname$i' , '$PTS$i', '$FGM$i' , '$FGA$i')");
$i++;
}
The $i gets printed correctly but somehow it just fills my database with "1"'s, that's something like 29366 rows !! That's really weird anyone know what this could be ?
Re: DB gets populated with 1's
Quote:
Originally posted by Choller
anyone know what this could be ?
no :( extremely strange though :confused:
IS this code even right ?
What i'm trying to do is to use two variables to enter the data into the database...
I need to get the values PTS1, GP1, PPG1, and then PTS2, GP2, PPG2 etc... i hope the above code is right.
Strangely it now puts the correct amount of records in the field :confused: :eek: :confused: . But the data is wrong, coz it just fills the recordid in all the fields instead of filling the actual data it needs to transmit.
I know the datas are being transmitted because i can echo them and they are correct.
For example i'm insterting a value "15" in an int table but it just inserts the table id...weird.
man...this is the last hurdle.