This topic is locked

spaces in tables and fields names

10/9/2007 5:55:43 AM
PHPRunner General questions
L
luck author

Hi,
I want to select one field from a table but i don't know how to manage spaces that i have in names of fields or tables.
I have something like that:
$strSelect = "select Email from _candidats visible where Poste recherche='".$values["Candidat recherche"]."'";
_candidats visible is the table name
Poste recherche is the field name
Candidat recherche is also a field name
and another one:
$strSQLInsert = "insert into _candidates visible (Email) values (Email)";
Please tell me how to include this table and this fields.
Thanks!

A
alang 10/9/2007

Use "back quote" character around them. ie
$strSQLInsert = "select Email from `_candidats visible` where `Poste recherche`='".$values["Candidat recherche"]."'"

$strSQLInsert = "insert into `_candidates visible` (Email) values (Email)";

L
luck author 10/9/2007

Thank you very much! Is working!