0

Hi
I have a problem with inserting into the database.
This is my code :

    $insert = $db_con->query("INSERT INTO users (username,password,email,com-name,com-logo,com-phone,com-mobile) 
        VALUES('".$username."','".$enc_pass."','".$email."','".$com_name."','".$profile_path."','".$com_phone."','".$com_mobile."')");
3
Contributors
14
Replies
38
Views
3 Years
Discussion Span
Last Post by keloa
Featured Replies
0

I'm new in mysqli, I'v tried this is it correct ?

    $insert = $db_con->query("INSERT INTO users (username,password,email,com-name,com-logo,com-phone,com-mobile) 
        VALUES('".$username."','".$enc_pass."','".$email."','".$com_name."','".$profile_path."','".$com_phone."','".$com_mobile."')")
        or die($db_con->error()); 

is it correct ?
I didn't understand your suggestion to be honest!

0

I got the error :
Erreur de syntaxe pr�s de '-name,com-logo,com-phone,com-mobile) VALUES('1','c4ca4238a0b923820dcc509a6f7' � la ligne 1
Idon't know why it's not in English!

Edited by keloa

0

I didn't understand what is you suggestion ! :(
can you rephrase your suggestion so I can understand it please? :)

0

yes I'm testing if it's work or not and didn't work.I'v tried several times with different values like : john,mark...etc but didn't work

Edited by keloa

0

The error :
Erreur de syntaxe près de ''users' ('username' ,'password' ,'email' ,'com-name' ,'com-logo' ,'com-phone' ,'' à la ligne 1

the code:

    $insert = $db_con->query("INSERT INTO 'users' ('username' ,'password' ,'email' ,'com-name' ,'com-logo' ,'com-phone' ,'com-mobile') 
        VALUES('".$username."','".$enc_pass."','".$email."','".$com_name."','".$profile_path."','".$com_phone."','".$com_mobile."')")
        or die($db_con->error); 
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.