Newbie Help - merging codes from 2 pages.[Solved]
Posted: Fri Jun 17, 2005 4:17 am
how can i merge this to codes into 1 $query ? is it possible?
I need both of the codes functionality for my admin.php. they both work seprately.
this is a nessesary code for my javascript "click to open row" function
and this is my select table from database code...
I need both of the codes functionality for my admin.php. they both work seprately.
Code: Select all
$orderBy = "";
if (!empty($_GET['sort'])) {
$orderBy = "ORDER BY " .sqlite_escape_string($_GET['sort']);
}
$query = "SELECT * FROM beer $orderBy";this is a nessesary code for my javascript "click to open row" function
and this is my select table from database code...
Code: Select all
if (isset($_GET['tableName'])) {
$table = sqlite_escape_string($_GET['tableName']);
}
$query = "SELECT * FROM $table ORDER BY title";
$result = sqlite_query($handle, $query) or die("Error in query: ".sqlite_error_string(sqlite_last_error($handle)));