RE: my code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx]
> Sent: Monday, March 01, 2004 11:48 AM
> To: php-db@xxxxxxxxxxxxx
> Subject:  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@xxxxxxxxxxxx> wrote in message
> news:20040301162916.91396.qmail@xxxxxxxxxxxxxxx
> > 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
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux