1
我正在做一個後臺項目 - 我第一次實現了添加,更新和刪除數據庫條目,現在我需要在某些數據類型上實施一些特定的操作。 所以我想檢索數據類型 只有$ fieldtypes = mysql_query(「SHOW FIELDS FROM mysqltable」);返回NULLSHOWFIELD從mysqltable沒有結果
這是代碼是如何在這個時候:
<?php
$serveur='localhost';
$user='root';
$password='xxxx';
$base='db';
$champs=array(
"member"=>array("id","group","login","lastname","firstname","email","pswd","account","searchingfor","searchingfordistance","searchedfor","searchedfordistance","mydescription","groupdescription","searchdescription","resourcesdescription"),
"place"=>array("id","idm","ids","name","town","postalcode","address","coord")
);
$connexion = mysql_connect("$serveur","$user","$password") or die ("Impossible de se connecter à la base de données");
mysql_select_db("$base",$connexion) or die("Erreur de connexion a la base de donnees");
$fieldtypes = mysql_query("SHOW FIELDS FROM place");
ob_start();
var_export($fieldtypes);
$tab_debug=ob_get_contents();
ob_end_clean();
$fichier=fopen('gs.log','w');
fwrite($fichier,$tab_debug);
fclose($fichier);
... (rest of code works)
誰能幫我找出什麼地方出了錯?
謝謝!
哦,是的 - 它的工作原理 - 非常感謝你:) – 2012-08-15 04:28:49