RE: [PHP-DB] my code
| From: | Hutchins, Richard | Date: | Mon, 01 Mar 2004 16:57:15 +0000 |
| Subject: | RE: [PHP-DB] my code | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-33235@lists.php.net to get a copy of this message | ||
For one thing, your column name Long is invalid. It's a reserved keyword in
MySQL. Either enclose it in backticks or change the name of the column.
If you want to see what the db is reporting, do this:
$result = mysql_query($query)
or die(mysql_error())
And see what the database tells you.
> -----Original Message-----
> From: Piet from South Africa [mailto:pieterdt@telkomsa.net]
> Sent: Monday, March 01, 2004 11:48 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] my code
>
>
> This is my code
>
> My function call:
>
> insert_property($name, $upfile1, $upfile2, $upfile3,
> $upfile4, $bed, $bath,
>
> $living, $dining, $reception, $garages, $flats, $servant,
> $pool, $jacuzzi,
> $lapa,
>
> $entertain, $security, $securest, $short, $long, $contact,
> $number, $mail,
> $fax,
>
> $period, $prov, $city, $area);
>
> My function:
>
> function insert_property($name, $upfile1, $upfile2, $upfile3,
> $upfile4,
> $bed, $bath,
>
> $living, $dining, $reception, $garages, $flats, $servant,
> $pool, $jacuzzi,
> $lapa,
>
> $entertain, $security, $securest, $short, $long, $contact,
> $number, $mail,
> $fax,
>
> $period, $prov, $city, $area)
>
> {
>
> global $link;
>
>
> $query = "insert into property (name, photo1, photo2, photo3,
> logo, bed,
> bath,
>
> living, dining, reception, garages, flats, servant, pool,
> jacuzzi, lapa,
>
> entertain, security, securest, short, long, contact, number,
> mail, fax,
>
> period, prov, city, area)
>
> values ('" . $name . "', '" . $upfile1 . "',
> '" . $upfile2 . "', '" .
> $upfile3 . "'
>
> ,'" . $upfile4 . "', '" . $bed . "', '" .
> $bath . "', '" .
> $living . "'
>
> ,'" . $dining . "', '" . $reception . "', '"
> . $garages . "',
> '" . $flats .
> "'
>
> , '" . $servant . "', '" . $pool . "', '" .
> $jacuzzi . "', '"
> . $lapa . "'
>
> , '" . $entertain . "', '" . $security . "',
> '" . $securest . "', '" .
> $short . "'
>
> , '" . $long . "', '" . $contact . "', '" .
> $number . "', '"
> . $mail . "'
>
> , '" . $fax . "', '" . $period . "', '" .
> $prov . "', '" . $city . "'
>
> , '" . $area . "')";
>
>
> $result = mysql_query($query);
>
> if (!$result)
>
> {
>
> echo "no result";
>
> }
>
> else
>
> {
>
> echo "";
>
>
> }
>
> }
>
>
> "Piet From South Africa" <pieterdt@telkomsa.net> wrote in message
> news:20040301162916.91396.qmail@pb1.pair.com...
> > Hi
> >
> > I want to know if there is a limit to the amount of columns
> that can be
> > created in a table, i have 30 columns, and i cannot insert
> data, i have
> > checked everything over and over again, even written a
> shorter insert
> > function that worked on the database.
> >
> > Can anyone help me here!!!!!
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>