Jump to content

putting array in mysql field


dolcezza

Recommended Posts

I wanted to put the array(mileage,hotel...) in the database and I am getting the word "array". 'm confused as to how to get it to put in the values. (posting only relevant code).

I moved this from the php forum because it is going into the databae as "array".

It is coming from:

<input type="checkbox" name="travelinc[]" value="mileage">mileage <input type="checkbox" name="travelinc[]" value="flight">flight <input type="checkbox" name="travelinc[]" value="hotel">hotel <input type="checkbox" name="travelinc[]" value="perdiem">per diem</p>

then used as:

$travelinc = ($_POST['travelinc']);
$query = "UPDATE events SET address='$address', city='$city', state='$state', zip='$zip', directions='$directions', honorarium='$honorarium', travelexp='$travelinc', sig='$sig', other='$eventnotes' WHERE eventid = '$eventid'";

$how_many = count($travelinc);
	if ($how_many>0) {
	$travelinc = 'N/A';
        }
        for ($i=0; $i<$how_many; $i++) {
			$pdf->MultiCell(0,5, $travelinc[$i] . ", ",0,0);

Link to comment
https://forums.phpfreaks.com/topic/86227-putting-array-in-mysql-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.