Page 1 of 1

INSERT INTO issue

Posted: Wed Dec 01, 2010 2:59 pm
by someguyhere
I'm trying to inert data into a table but I am getting the following error:

Warning: mysqli_query() expects at least 2 parameters, 1 given in /home1/wildfir1/public_html/AREA-52/AG/index.php on line 33

What's wrong with my code?

Code: Select all

		mysqli_query("INSERT INTO ag_pages (page_url, page_title, page_body) 
		VALUES ('/AREA-52/AG/test.htm', 'Test Page', 'This is a test page')");

Re: INSERT INTO issue

Posted: Wed Dec 01, 2010 3:06 pm
by s992
It looks like you need the link identifier. I'm not familiar with mysqli, but I checked the manual.

Re: INSERT INTO issue

Posted: Wed Dec 01, 2010 3:08 pm
by someguyhere
That's the info I needed, thanks!

New, functional code:

Code: Select all

$mysqli->query("INSERT INTO ag_pages (page_url, page_title, page_body)
VALUES ('/AREA-52/AG/test.htm', 'Test Page', 'This is a test page')");