cd_catalog.xml html.html htmlpage.html out.html help.txt mysqlinit.txt signature.txt action.php action1.php actioni.php catalog.php catalog.save.php emailphp.php emailphptest.php emailphptext.php form.php form1.php formphp.php formphp1.php formphpi.php getcd.php getenv.php getenv1.php henrylogin.php mysqlcreate.php mysqlcreate1.php mysqlcreate2.php mysqlcreate3.php mysqlcreate4.php mysqlcreatei.php mysqlcreatetable.php mysqldel.php mysqldel1.php mysqldelete.php mysqldelete1.php mysqldeletei.php mysqldeli.php mysqldriver.php mysqldriver1.php mysqldriveri.php mysqldriversave.php mysqlinsert.php mysqlinsert1.php mysqlinserti.php mysqlitable.php mysqltable.php mysqltable1.php mysqltablei.php oopinsert.php out.php outout.php processscript.php processscript1.php sakila.php shuffle.php shufflesave.php tempstyle.php test1.php test2.php testfile.php testfname.php testpost.php testreceive.php testx.php testy.php style.css Number of files = 66 online compaq devendra athlon kingston kingston2 kingston3 kingston4 pi pi2 pi3 Page created on February 11th 2014 and updated on November 30th. 2017. Visitor number home launcher guestbook |
1. <HTML><HEAD><TITLE>Create a table called Persons in a database called onwardov_testdb1i.</TITLE>
2. <link rel="stylesheet" type="text/css" href="style.css"> 3. </HEAD> 4. <BODY><FONT FACE=ARIAL> 5. <CENTER><H1>Create a table called Persons in a database called onwardov_testdb1i.</H1></CENTER> 6. <P>from:-<A HREF=https://www.w3schools.com/php/php_mysql_create.asp> 7. https://www.w3schools.com/php/php_mysql_create.asp</A> Create a database</P> 8. <P>and:-<A HREF=https://www.w3schools.com/php/php_mysql_create_table.asp> 9. https://www.w3schools.com/php/php_mysql_create_table.asp</A> Create a table in the database</P> 10. <?php 11. $servername = "localhost:3306"; 12. $username = "onwardov_henry"; 13. $password = "Xbloodychristmas7"; 14. $dbname = "onwardov_testdb1i"; 15. // Create a connection to the server 16. $conn = mysqli_connect($servername, $username, $password); 17. // Check connection 18. if (!$conn) { 19. die("Connection failed: " . mysqli_connect_error($conn)); 20. } 21. // Create database 22. $sql = "CREATE DATABASE " . $dbname; 23. if (mysqli_query($conn, $sql)) { 24. echo "Database successfully created<BR>\n"; 25. } else { 26. echo "Error creating database: " . $dbname . "<BR>\n" . mysqli_error($conn) . "<BR>\n"; 27. echo "never mind if it exists already <BR>\n"; 28. } 29. // Now close the connection to the server and then open a connection to the database 30. mysqli_close($conn); 31. // Create a connection to the database 32. // Notice the addition of a 4th. argument 33. $conn = mysqli_connect($servername, $username, $password, $dbname); 34. // Check connection 35. if (!$conn) { 36. die("Connection failed: " . mysqli_connect_error($conn) . "<BR>\n"); 37. } 38. // Now create a table in the database you have just created on the server 39. $sql = "CREATE TABLE Persons(FirstName varchar(15),LastName varchar(15),Age int)"; 40. if (mysqli_query($conn, $sql)) { 41. echo "Table Persons created successfully<BR>\n"; 42. } else { 43. echo "Error creating table Persons: " . mysqli_error($conn) . "<BR>\n"; 44. echo "never mind if it exists already <BR>\n"; 45. } 46. mysqli_close($conn); 47. ?> 48. <FONT SIZE=6><BR>Done.<BR><BR> 49. <FONT SIZE=1><BR>Page created on December 16th. 2017.<BR><BR> 50. <FONT SIZE=3> 51. <FORM ACTION="mysqldriveri.php" method="get"> 52. <INPUT type="hidden" name="fname" value="mysqltablei.php"> 53. <INPUT class="btn-secondary" type="submit" name ="mysqltablei" value="mysqltablei"> 54. </FORM> 55. </BODY></HTML> 56. |