PHP Code:
if ($_REQUEST['letter'] == "all") {$Letter = '123, A, B, C, D, E, F, G, H, I, J, K, L, M, N, I, O, P, Q, R, S, T, U, V, W, X, Y, Z' ;}else{$Letter = $_REQUEST['letter'];};
if( !isset($_GET['k'])) {
$SQL="SELECT COUNT(*) AS Total FROM `$Letter`";
$SQL_Result=mysql_db_query($DB_Name, $SQL);
$SQL_Result_Array=mysql_fetch_array($SQL_Result) || die(mysql_error());
$Total=$SQL_Result_Array['Total'];
// Create a new SELECT Query with the ORDER BY clause and without the COUNT(*)
$SQL="SELECT * FROM `$Letter` ORDER BY Name";
}else{
$k = $_REQUEST['k'];
// Run The Query Without a Limit to get Total result
$SQL='SELECT COUNT(*) AS Total FROM `$Letter` WHERE Name LIKE "' .$k. '"';
$SQL_Result=mysql_db_query($DB_Name, $SQL);
$SQL_Result_Array=mysql_fetch_array($SQL_Result) || die(mysql_error());
$Total=$SQL_Result_Array['Total'];
// Create a new SELECT Query with the ORDER BY clause and without the COUNT(*)
$SQL='SELECT * FROM `$Letter` WHERE Name LIKE "' .$k. '" ORDER BY Name';
};
Now giving the error of -
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\http\ac\amiga\gs.php on line 27
Table 'amigagames.$letter' doesn't exist
Why isnt it using the defined $Letter rather than actually writing $letter?
NS