我正在做一个后台项目——我首先实现了添加、更新和删除数据库条目,现在我需要对某些数据类型实施一些特定的操作。所以我想只检索数据类型 $fieldtypes = mysql_query("SHOW FIELDS FROM mysqltable"); 返回 NULL
这就是此时的代码:
<?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)
谁能帮我找出问题所在?
谢谢!