$con = mysql_connect("localhost","music123_sri","password");
if (!$con)
{ die('Could not connect: ' . mysql_error()); }
mysql_select_db("music123_telugu", $con);
$sql="INSERT INTO xml (File) VALUES (" . mysql_escape_string($xmlString) . ")";
$data = mysql_query("SELECT File FROM xml")
$info = mysql_fetch_array( $data );
can u help me in coding for connecting to database and inserting data and retrieving data
As I wrote in some other answer to one of your questions: please read some introduction on how to use PHP with MySQL. A lot of problems will disappear when you get some sort of understanding on how these pieces fit together.
In your concrete example you have three problems:
INSERT
-query is never executed as it's never send to the database server mysql_fetch_array()
I won't give you a finished code snippet but some advice: carefully read the PHP manual for mysql_query()
and mysql_fetch_array()
and try to understand how they fit into your code.
尝试在$data = mysql_query("SELECT File FROM xml")
之后添加分号。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.