for some reason, my MySQL select wont gather and output what i was hoping it would say
This is my coding. Be aware, since im only a beginner with MySQL, this has some notes, to help me remember.
<?php
$user = "root";
$pass = "";
$database = "test";
######################Connect##########################################
$link = @mysql_connect( "localhost", $user, $pass );
if ( ! $link )
{
die( "Could not connect to MySQL<br><br>ERROR: ".mysql_error() );
}
$link2 = @mysql_pconnect( "localhost", $user, $pass );
if ( ! $link2 )
{
die( "Could not connect to MySQL<br><br>ERROR: ".mysql_error() );
}
######################Select Database##################################
@mysql_select_db( $database )
or die ( "Could not open $database<br><br>ERROR: ".mysql_error() );
######################Create Table#####################################
$xR = "CREATE TABLE res ( title VARCHAR(30), author VARCHAR(40), domain VARCHAR(250), desc VARCHAR(100) )";
$createxR = mysql_query( $xR, $link );
######################Add Data to Table################################
$add_A = "INSERT INTO res( title, author, domain, desc ) values( 'Darth' 'DXL' 'http://www.gamingw.net/' 'Darth is back' )";
mysql_query( $add_A );
######################Obtaining the Data###############################
$select = "SELECT author FROM res WHERE title = 'Darth'";
$found = mysql_query( $select );
print("Thank you for submitting your resource, $found");
?>
for some reason, it will not display "DXL" after the comma. help 🙁 😕