[PHP-DB] Query and math

2003-12-16 Thread Patrik Fomin
Hi, q1) i got a database with 2 diffrent tables, i want to take out all the information that arent duplicated from on of the tables, like this: $sql = "SELECT t1.rubrik, t1.info, t2.priser FROM table1 AS t1, table2 AS t2 WHERE t1.arkiv = '0' ORDER BY t1.rubrik"; the problem is that i got alot of

Re: [PHP-DB] silly problem

2003-07-22 Thread Patrik Fomin
yeah ofcourse, sometimes u can go blind stairing at the code and still not see it :D thanks "Edward Peloke" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > you are missing the $ sign on your second mysql_query call > > -Original Message- >

[PHP-DB] silly problem

2003-07-22 Thread Patrik Fomin
$sql = "UPDATE dagensfraga SET nej = '$nej' WHERE id = '$iid' AND aktuellfraga = '1'"; mysql_query($sql); $sql = "INSERT INTO dagensfragaip (aid, ip) VALUES('$iid', '$REMOTE_ADDR')"; mysql_query(sql); when i run this only the first line is recorded into the databse?, when i run the second l

[PHP-DB] Hi, simple question

2003-07-01 Thread Patrik Fomin
Hi, im adding a post to the database, is there any way to retrive back the ID for the post that i just created? the id is auto_increment and primary key. like $sql = "insert into test (namn, www) values('test', 'test.com')"; mysql_query($sql); $row = mysql_get_post("id"); ? the only way i coul