2012-12-05 63 views
0

請幫我在這裏,我不知道什麼是實際的錯誤意味着什麼,但我正在尋找任何方式使這項工作!請!php更新--- T_CONSTANT_ENCAPSED_STRING錯誤

<?php 

//session_start(); 
include("config.php"); 
include("auth.php"); 

if($_SESSION['SESS_MEMBER_ID'] != 'true') { 
// header("location:member-index.php"); 
    } 

//connects to database 
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); 
if (!$link) { 
    die("Failed to connect to server: " . mysql_error()); 
    } 

    //selects database 
$db = mysql_select_db(DB_DATABASE); 
if (!$db) { 
    die ("Unable to select database"); 
    } 

這是哪裏出錯

$qry = "UPDATE members set firstname="'.$firstname.'", lastname="'.$lastname.'", location="'.$location.'", email="'.$email.'", cell_number="'.$cell_number.'", home_number="'.$home_number.'", about="'.$about.'" where member_id="'.$_SESSION['SESS_MEMBER_ID'].'" " 


$result = @mysql_query($qry); 


?> 
+0

什麼是錯誤信息? – SchmitzIT

回答

1

變化

$qry = "UPDATE members set firstname="'.$firstname.'", lastname="'.$lastname.'", location="'.$location.'", email="'.$email.'", cell_number="'.$cell_number.'", home_number="'.$home_number.'", about="'.$about.'" where member_id="'.$_SESSION['SESS_MEMBER_ID'].'" " 

$qry = "UPDATE members set firstname='".$firstname."', lastname='".$lastname."', location='".$location."', email='".$email."', cell_number='".$cell_number."', home_number='".$home_number."', about='".$about."' where member_id='".$_SESSION['SESS_MEMBER_ID']."' "; 

注:強烈建議使用預準備語句代替使用mysql_ *函數。

+0

打我吧;)!或者mysqli – Phorce

+0

@Phorce:不是_或_ mysqli_ *',你至少必須使用'mysqli_ *'來使用預處理語句。將此查詢傳遞給mysqli與使用已棄用的擴展一樣危險。不過,優先使用PDO,因爲它提供了更廣泛的數據庫驅動程序,並擁有更好的API( –

+1

@Dr。丹我的壞!我累了,過了漫漫長夜。對不起,愚蠢的錯誤 – Phorce

相關問題