Justtechjobs.com Find a programming school near you






Online Campus Both


php-developer-list | 2000111

Re: [PHP-DEV] PHP 4.0 Bug #7830: How can I insert new records into a table? From: the_noid <email protected>
Date: 11/15/00

On 0, n.vieira <email protected> wrote:
> From: n.vieira <email protected>
> 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 :)

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>