• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

What wrong with this query ?

GregT

Waffles!!
NLC
PHP tells me this query is invalid

$insert = mysql_db_query("INSERT INTO ds_articles VALUES ('$name','$text','$authorn', '$date')");

Warning: Wrong parameter count for mysql_db_query() in /home/zero/public_html/devplace/beta/admin/newarticle.php on line 21

Adding it manually like this

INSERT INTO ds_articles
VALUES (
'Test Article', 'Testing !!! 123...', 'Zero', '12.02.05'
)

through phpmyadmin works :confused:

Please help me !
 
It's mysql_query, not mysql_db_query:

PHP:
$insert = mysql_query("INSERT INTO ds_articles VALUES ('$name','$text','$authorn', '$date')");
 
Now I have another question, I get no errors on this, but when I do it the author table comes up empty
PHP:
 $result = mysql_query("SELECT `nickname` FROM `ds_users` WHERE username='" . addslashes($author) . "' LIMIT 1");
 $author = mysql_fetch_row($result);
 addslashes("$name");
 addslashes("$text");
 addslashes("$author");
 addslashes("$date");
 
 $insert = mysql_query("INSERT INTO ds_articles VALUES ('$name','$text','$author', '$date')");

I believe it's because of improper use of mysql_fetch_row ?
 
Back
Top