Need Programming Assignment Help?

Get Help with Programming Assignment in Java, C/C++, Dot Net, PHP, Database and UML Diagrams

All posts tagged MySQL

MySQL Dump to Database

MySQL Dump to Database The MySQL Dump command is used to create textfile “dumps” of databases managed by MySQL. <?php // open the .sql file $fp = @fopen(“mysql.sql”, “r”); $file = fread($fp, 80000); fclose($fp); $lines = explode(‘;’, $file); // split the .sql into sepearte queries $cnt = count($lines); // count array . . . Read more

MySQL Select Associative Array

MySQL Select Associative Array MySQL Select Associative Array- This will fetch a result row as a numeric and an Associative Array from MySQL result handle. <?php $conn = mysql_connect(“localhost”, “mysql_user”, “mysql_password”); if (!$conn) { echo “Unable to connect to DB: ” . mysql_error(); exit; } if (!mysql_select_db(“mydbname”)) { echo “Unable . . . Read more

Error Checking MySQL Code in PHP

Error Checking MySQL Code in PHP Error Checking MySQL Code – This simple PHP Programming code returns the text of the error message from previous MySQL operation. <?php mysql_connect(“localhost”, “mysql_user”, “mysql_password”); mysql_select_db(“nonexistentdb”); echo mysql_errno() . “: ” . mysql_error(). “\n”; mysql_select_db(“kossu”); mysql_query(“SELECT * FROM nonexistenttable”); echo mysql_errno() . “: ” . . . . Read more

Creating New Database in PHP

New Database in PHP <?php $link = mysql_pconnect(“localhost”, “mysql_user”, “mysql_password”) or die(“Could not connect: ” . mysql_error()); if (mysql_create_db(“my_db”)) { print (“Database created successfully\n”); } else { printf (“Error creating database: %s\n”, mysql_error()); } ?>

Basic MySQL Example in PHP

MySQL Example in PHP Basic MySQL Example Program in PHP – Its is the simple programming example for creating MySQL program in PHP Programming. <?php /* Connecting, selecting database */ $link = mysql_connect(“mysql_host”, “mysql_user”, “mysql_password”) or die(“Could not connect”); print “Connected successfully”; mysql_select_db(“my_database”) or die(“Could not select database”); /* Performing . . . Read more