INSERT INTO issue

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
someguyhere
Forum Contributor
Posts: 181
Joined: Sun Jul 27, 2008 3:24 pm

INSERT INTO issue

Post 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')");
s992
Forum Contributor
Posts: 124
Joined: Wed Oct 27, 2010 3:06 pm

Re: INSERT INTO issue

Post by s992 »

It looks like you need the link identifier. I'm not familiar with mysqli, but I checked the manual.
someguyhere
Forum Contributor
Posts: 181
Joined: Sun Jul 27, 2008 3:24 pm

Re: INSERT INTO issue

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