[solved]-Write Php Script Obtains Url Descriptions User Stores Information Database Using Mysql Cre Q39053960
Write a PHP script that obtains a URL and its descriptions froma user and stores the information into a database using MySQL.Create and run a SQL script with a database named URL and a tablenamed Urltable. The first field of the table should contain anactual URL. Use www.deitel.com as the first URL, and input CoolCite! as its description. The second URL should be www.php.net, andthe description should be the official PHP site. After each new URLis submitted, print the contents of the database in a table. [Note;Follow the instructions in Section 18.5.2 to create the URLdatabase by using the URLs.sql script that’s provided with thischapter’s examples in the dbscripts folder.}
the conversion from mysql to mysqli is straightforward.
if ( !( $database = mysqli_connect( “localhost”, “iw3htp”,”password” ) ) )
die( “<p>Could not connect to database</p>” );
if ( !mysqli_select_db( $database, “URLs”) )
die( “<p>Could not open URL database</p>” );
if ( !( $result = mysqli_query( $database, $query) ) )
{
print( “<p>Could not execute query!</p>” );
die( mysqli_error() );
}
while ( $row = mysqli_fetch_row( $result ) )
print( “<tr><td>” . $row[ 0 ] . “</td><td>”. $row[ 1 ] . “</td></tr>” );
mysqli_close( $database );
Expert Answer
Answer to Write a PHP script that obtains a URL and its descriptions from a user and stores the information into a database using … . . .
OR

