Insert not a clue how to do

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
doggy
Forum Commoner
Posts: 80
Joined: Tue Dec 09, 2003 5:01 am
Location: South Africa

Insert not a clue how to do

Post 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]
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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 ...")
Post Reply