这有什么问题?:
$info = mysql_fetch_row(mysql_query("SELECT * FROM biblia_forditasok
WHERE id=$_SESSION[bible]"));
这是我的一些代码:
if((isset($_POST['online-bible-read-btn']) || $_GET['type'] == 'simple') && !isset($_POST['bible_search']))
{
if(isset($_POST['bible'])) $_SESSION['bible'] = $_POST['bible'];
$info = mysql_fetch_row(mysql_query("SELECT * FROM biblia_forditasok WHERE id=$_SESSION[bible]"));
if(isset($_POST['chapter_select']))
$_SESSION['chapter'] = $_POST['chapter_select'];
if($_SESSION['chapter'] == 0) $_SESSION['chapter'] = 1;
$_SESSION['type'] = 'simple';
最佳答案
尝试这个
if(isset($_POST['bible'])){
$_POST['bible'] = mysql_real_escape_string($_POST['bible']) ;
$_SESSION['bible'] = $_POST['bible'];
}
$info = mysql_fetch_row(mysql_query("SELECT * FROM biblia_forditasok
WHERE id='".$_POST['bible']."' "));