What is the problem with php operating the database?

$sql = "insert into user (account,password,mail,phone,) VALUES (". $account.",".$password.",".$mail.",".$phone.")";

$query = $this- > link- > query ($sql);
when inserting data into the database, the VALUES parentheses should be written in the form of variables. Is this correct?

Php
Mar.06,2021

check the representation of PHP strings, the difference between single and double quotes


$sql = "insert into user(account,password,mail,phone) VALUES ('".$account."','".$password."','".$mail."','".$phone."')";

suggest that you use sprintf, to be more intuitive


  

single quotation marks do not resolve variables, double quotation marks resolve variables, just replace single quotation marks with double quotation marks

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be9a0d-3197c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be9a0d-3197c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?