Page 1 of 1

Insert not a clue how to do

Posted: Mon Feb 02, 2004 2:04 am
by doggy
I have a db class called db

now this is how i do a select

Code: Select all

<?php
$DB = new DB;                                                                                                                                    
$DB->sql = "SELECT * FROM pages where id = '$id'";                                                                                                  
$DB->result = mysql_query($DB->sql);                                                                                                       ?>

but i have no idea how to do a insert please help and i will learn to help my self, thanks

[/php_man]

Posted: Mon Feb 02, 2004 2:49 am
by timvw
all queries, thus all "insert ... " , "select ... ", "update ..." instructions are passed to mysql through the mysql_query function. So you need to to do mysql_query("insert into ...")