Search Tutorials
The Answer ScriptIn the attached zip file are different scripts for each db for returning the answer. Select the one for your database, rename the file to answer.php and place it in the root directory of dgssearch (the same location as search.php)MySQL Answer Script
<?
/*
** answer_mysql.php
** Quick db query to display the answer of the question
** This is necessary because we dont want all the
** answers loading into the flash on the first query.
** Thats why we execute twice.
*/
require("config/config.php");
/* Get the variables from the config file */
$answertable = $database[0]["answertable"];
$server = $database[0]["server"];
$username = $database[0]["username"];
$password = $database[0]["password"];
$database = $database[0]["database"];
/* Get the variables sent from the Flash*/
$id = $HTTP_POST_VARS["id"];
/* Connect to MySQL */
mysql_pconnect($server, $username, $password);
/* Connect to Specified Database */
@mysql_select_db("$database")or die("&theTruth=DatabaseError&answerloaded=1");
/* Find the answer and display it */
$result = mysql_query("select answer from $answertable where id = $id");
while (list($answer) = mysql_fetch_row($result)) {
print("&theTruth=$answer");
}
print("&answerloaded=1");
?>
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|