$sql=mysql_query("select * from dosyabegeni where veri_id=''.get_custom_field('dwcode').''");
我想向下面的PHP代碼:如何在代碼中添加MySQL代碼?
<?php get_custom_field('dwcode'); ?>
...怎麼了?
=''.get_custom_field('dwcode').''");
主要代碼:
<?php
include('/home/test/public_html/EntegreOz/DosyaBegeni/config.php');
$sql=mysql_query("select * from dosyabegeni where veri_id=".get_custom_field('dwcode')."");
while($row=mysql_fetch_array($sql))
{
$sira_id=$row['sira_id'];
$veri_id=$row['veri_id'];
$begeni=$row['begeni'];
?>
謝謝!
我知道..我不能告訴更多的,對不起的英語
請不要使用'mysql_ *'函數來編寫新的代碼。他們不再維護,社區已經開始[棄用程序](http://goo.gl/KJveJ)。請參閱* [紅盒子](http://goo.gl/GPmFd)*?相反,您應該瞭解[準備好的語句](http://goo.gl/vn8zQ)並使用[PDO](http://php.net/pdo)或[MySQLi](http://php.net/ mysqli的)。如果你不能決定哪些,[這篇文章](http://goo.gl/3gqF9)會幫助你。如果你選擇PDO,[這裏是很好的教程](http://goo.gl/vFWnC)。 –
請**使用'mysql_query'來停止**,就像你在這裏一樣。你會陷入嚴重的麻煩。這段代碼有一個嚴重的[SQL注入漏洞](http://bobby-tables.com/php),可以[自動利用](http://sqlmap.org/)。 – tadman