Re: PHP 4.0 Bug #7830: How can I insert new records into a table?
| From: | the_noid at dds dot nl | Date: | Wed, 15 Nov 2000 15:23:09 +0000 |
| Subject: | Re: PHP 4.0 Bug #7830: How can I insert new records into a table? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-38143@lists.php.net to get a copy of this message | ||
On 0, n.vieira@oninet.pt wrote:
> From: n.vieira@oninet.pt
> Operating system: Windows 98
> PHP version: 4.0.3pl1
> PHP Bug Type: MySQL related
> Bug description: How can I insert new records into a table?
>
> I have been trying to insert records into a mysql table using mysql_query() and
> mysql_db_query() but i have had no success...
> Is there a mysql_insert() command? If there is then what is the syntax?
> How can i insert records with mysql?
This has nothing to do with PHP, mysql_query only passes a command to the
mysql server. You have to use the INSERT command in the SQL query you pass
to mysql_query(). like:
$querystring="INSERT INTO tablename (column1, column2) VALUES (value1, value2)";
mysql_query($querystring);
See the mysql manual (www.mysql.com) for more details.
Hylke
--
Hi, I'm a signature virus. plz set me as your signature and help me
spread :)