The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Here's the deal.
Got an array called "images".
After attempting to put the values into the database (i.e. $this->images[$i] with $i being a counter in a for loop)
All I get within my database is instead of the array value itself, I just get
"Array[0]"
"Array[1]"
etc
How do I get it to insert the proper values of the array, for example, if array[0] had "cheese" as it's value, then I would want "cheese" to be put into the database when Array[0] was called.
$sql="INSERT INTO Images VALUES('','$this->AID', '$this->image[$i]')";
to:
$sql="INSERT INTO Images VALUES('','".$this->AID."', '".$this->image[$i]."');";
and see if it works then.
for($i=0; $i<=2;$i++) {
$sql="INSERT INTO Images VALUES('','$this->AID', '$this->image[$i]')";
echo $this->image[$i]."
"; //Just print the values to see if they are there
if(!$result = mysql_query($sql)) {
echo("
Error: " .
mysql_error() . "
}
else {
unset($sql);
unset($result);
}
}
}
Any guesses?
The results that are returned in the database are just
ImadeID=# (auto incremented number)
AID=(secondary key)
ImageURL="Array[0]"
ImadeID=# (auto incremented number)
AID=(secondary key)
ImageURL="Array[1]"
ImadeID=# (auto incremented number)
AID=(secondary key)
ImageURL="Array[2]"
Yet when echoing the contents of $this->image[$i] it returns the results perfectly so there is nothing wrong with the array in itself!
Any ideas?
Here's the deal.
Got an array called "images".
After attempting to put the values into the database (i.e. $this->images[$i] with $i being a counter in a for loop)
All I get within my database is instead of the array value itself, I just get
"Array[0]"
"Array[1]"
etc
How do I get it to insert the proper values of the array, for example, if array[0] had "cheese" as it's value, then I would want "cheese" to be put into the database when Array[0] was called.