SAE platform, the database is open, the table has been built, want to implement the function: Query field A contains the record of content A, return the field B value of the record:
The code is as follows:
$mysql = new Saemysql ();
echo "Connect success
\ n ";
$sql = mysql_query ("Select * from ' nature ' WHERE ' name ' like \ ' Wolf ' LIMIT 0, 30");
$data = $mysql->getdata ($sql);
echo $data [' class '];
?>
The result of the operation is:
Connect success
Warning:mysql_query () [Function.mysql-query]: This app isn't authorised in index.php on line 5
Warning:mysql_query () [function.mysql-query]: A link to the server could not being established in index.php on line 5
Warning:mysqli_query () [function.mysqli-query]: Empty query in saemysql.class.php on line 191
Is it wrong to ask the next members greatly?
Reply to discussion (solution)
$sql = mysql_query ("Select * from ' nature ' WHERE ' name ' like ' Wolf ' LIMIT 0, 30");
$sql = mysql_query ("Select * from ' nature ' WHERE ' name ' like '% Wolf% ' LIMIT 0, 30");
Moderator greatly, tried the two code you provided, are still the same warning ...
Does saesql not define mysql_query function?
Don't understand what the reason is ...
Look at preoccupied.
You use the Saemysql class, how do you still use the MySQL function?
$mysql->getdata ($sql)
In $sql is the SQL instruction string
$sql = "Select * from ' nature ' WHERE ' name ' like '% Wolf% ' LIMIT 0, 30";
Thank you very much moderator, under your guidance, has realized I want the function!