LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-07-2004, 02:21 AM   #1
lynger
Member
 
Registered: Nov 2003
Posts: 36

Rep: Reputation: 15
php code


hi forum.

i'm thinking of where did it went wrong.. code doesn't add a new record to a local mysql database.

coming from an input page ...

pls see:

<head><title>add</title></head>
<body>
<?php
echo $_POST["item"]; //i put this on for testing if i got the correct item
$item = addslashes($item);
@ $db = mysql_pconnect("localhost", "test");
mysql_select_db("mydb");
$sql="Insert into Item values('".$item."')";
$query= mysql_query($sql);
if(!$query){
echo mysql_affected_rows()."entry not inserted.";
} else {
echo mysql_affected_rows()."entry inserted.";
}
?>
</body>
</html>



pls help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help With PHP Code windisch Programming 4 09-09-2005 07:37 AM
a problem on my php code. babyboss Programming 12 08-16-2005 09:07 PM
php in html code blizunt7 Programming 5 06-15-2005 01:08 PM
Newbie needs help with PHP code mclard Programming 7 12-09-2004 12:50 PM
PHP MySQL code pnh73 Programming 13 09-29-2003 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration