I need these SQL statements in PHP only
Well, I understand that you’re using php to access the database. But my point above was that SQL is used by the database: php does not “use” SQL statements at all. As far as PHP is concerned, it is not “code” at all; it’s just plain text.
That’s why it is so useful, when you’re having a problem with an SQL statement, to actually
echo the final statement out and test it directly in the database (or using a tool like sqlfiddle.com).
i need your support for update and delete coding . i want to update the record in the table from web page . means i will click on update in from of row and it should redirect to update page and required field should get update .
I understand your goals, and I would be happy to help you.
I do not understand what your actual question is.
You need to be specific. What is actually going wrong? What happens, compared to what you expect? “Not working” is not a helpful thing to say. It is so vague as to be basically meaningless (it could mean almost anything; from “forgot a semicolon” to “didn’t plug in the computer”).
Are you getting error messages?
(do you have error reporting enabled?)
Again, if the problem is in your SQL statement, it will be much easier to troubleshoot from MySQL than from PHP.
Another bit of advice, looking at your code: don’t use
htmlspecialchars when you insert data into the database.
mysql_real_escape_string is the appropriate* function here.
htmlspecialchars should be used when you display text in HTML.
* again, however, you should not use the
mysql_ functions at all.
Working with ext/mysql because you have an existing codebase is one thing; but you are learning and writing new code. Use PDO or MySQLi instead.