出于某种原因,我的 SQL 不会连接任何想法?我使用函数连接到 SQl 但遇到了一些麻烦,因为它告诉我 $row_results 没有返回任何数据。
function db_connect() {
$db_connect = mysql_connect($db_host, $db_user, $db_pass);
if (!$db_connect)
{
die('Can not connect: ' . mysql_error());
}
mysql_select_db($db_name, $db_connect);
}
function db_close() {
mysql_close($db_connect);
}
function db_select($table_name, $table_where) {
$row_result = mysql_query("SELECT * FROM '$table_name' WHERE email='$table_where'");
$row_get = mysql_fetch_array($row_result);
$row_count = mysql_num_rows($row_result);
}
db_connect();
db_select("attachments", "email@email.com");
die($row_get['email']);
db_close();