Advertisement
Guest User

Untitled

a guest
Mar 13th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php
  2. $serveur='localhost';
  3. $user='root';
  4. $password='xxxx';
  5. $base='db';
  6. $champs=array(
  7. "member"=>array("id","group","login","lastname","firstname","email","pswd","account","searchingfor","searchingfordistance","searchedfor","searchedfordistance","mydescription","groupdescription","searchdescription","resourcesdescription"),
  8. "place"=>array("id","idm","ids","name","town","postalcode","address","coord")
  9. );
  10.  
  11. $connexion = mysql_connect("$serveur","$user","$password") or die ("Impossible de se connecter à la base de données");
  12. mysql_select_db("$base",$connexion) or die("Erreur de connexion a la base de donnees");
  13.  
  14. $fieldtypes = mysql_query("SHOW FIELDS FROM place");
  15.  
  16. ob_start();
  17. var_export($fieldtypes);
  18. $tab_debug=ob_get_contents();
  19. ob_end_clean();
  20. $fichier=fopen('gs.log','w');
  21. fwrite($fichier,$tab_debug);
  22. fclose($fichier);
  23.  
  24. ... (rest of code works)
  25.  
  26. $fields = array();
  27. $fieldtypes = mysql_query("SHOW FIELDS FROM place");
  28. if ($fieldtypes) {
  29. while ($row = mysql_fetch_assoc($fieldtypes)) {
  30. $fields[] = $row;
  31. }
  32. }
  33. ob_start();
  34. // Dump your $fields array
  35. var_export($fields);
  36. $tab_debug=ob_get_contents();
  37. ob_end_clean();
  38.  
  39. // Don't quote these vars -- it's poor practice
  40. $connexion = mysql_connect("$serveur","$user","$password")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement