Reply to Re: [PHP] Unable to send variables to MySQL table

Your name:

Reply:


Posted by Richard Davey on 10/20/38 11:31

Hi Stewart,

Wednesday, November 9, 2005, 7:15:39 PM, you wrote:

> The script executes with no errors, but when I check the table, the
> table is still empty. I can manually insert the data directly into
> the table, and when I echo the variables in the script, the values
> are displayed whe I run it, but for reasons unknown, the values are not written to the table.

> $add_to_db = "insert into invoices (item1_desc, item1_cost,
> item2_desc, item2_cost, item3_desc, item3_cost, item4_desc,
> item4_cost, delivery_cost) values ('$item1_desc', '$item1_cost',
> '$item2_desc', '$item2_cost', '$item3_desc', '$item3_cost',
> '$item4_desc', '$item4_cost', '$delivery_cost')";
> mysql_query($add_to_db);

?>>

On the surface it looks fine, so I would echo out your query and then
paste it into MySQL (phpmyamin, SQLyog, etc) and check it works!

Or you could capture the result of the query and check for an error.

If there isn't one, it's probably a table design issue.

Cheers,

Rich
--
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация