General |  Social Media |  Miscellaneous
Login | Register
srcraft blog logo
  • Business
  • News
  • Shopping
  • Travel
  • Disease
  • Pets
  • Life
  • Health
  • Technology
  • Category
  • Contact Us
Latest Blog : 
☛ Who can be called a true monk ? ☛ God arranges everything ☛ Faith in god ☛ What is a Rotary Encoder? How does it work? ☛ Things to Know About PLC and SCADA ☛ According to Ramayana, why do women wear jewelry? ☛ After registering an FIR, can I not apply for a government job ☛ Daughter: A angel of his father ☛ How VOIP Phone System is Useful For your Business? ☛ test 
Home > Innovation & Technology > Mysql

Inserting Data into MySQL Database with PHP problem


Inserting Data into MySQL Database with PHP problem

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's neck. It is strong and rust-resistant Buy Trixie Long Link Choke chain, stainl' at line 1

If you are working with PHP, Mysql and you are getting error by single quote in string. It is possible to escape the apostrophe so that string is correctly inserted into the database table.

Before:

$conn = mysqli_connect('localhost','root','','dbname') or die('Error connecting to MySQL server.');

$cust_name = $_POST['cust_name'];

If you are using above syntax for getting data from form elements then you are getting the above error.

Here, Try your query again after replacing the PHP code with mysql_real_escape_string PHP function that collects the form element value and inserted into database without any error.

Now:

$conn = mysqli_connect('localhost','root','','dbname') or die('Error connecting to MySQL server.');

$cust_name  = mysqli_real_escape_string($conn, $_POST['cust_name']);

 

For more details, You can visit on below mention link

mysqli real escape string

Written By: Charles Miller Published in Mysql


Search

Publish your passions on srcraftblog.com

Latest Post

☛ Who can be called a true monk ?

☛ God arranges everything

☛ Faith in god

☛ What is a Rotary Encoder? How does it work?

☛ Things to Know About PLC and SCADA

☛ According to Ramayana, why do women wear jewelry?

☛ After registering an FIR, can I not apply for a government job

☛ Daughter: A angel of his father

☛ 'Gurukul' literally means 'family of Guru' or 'clan of Guru'

☛ When does mother's honor get less


We are accepting well-written informative Guest Posts on srcraftblog.com

Innovation & Technology

Artificial Intelligent blogs
Cryptocurrency blogs
Digital India blogs
Data science blogs
Neuroscience blogs
Programming blogs

Physical science

Physics blogs
Chemistry blogs
Earth science blogs
Geology blogs
Oceanography blogs
Meteorology blogs

Industry

Business blogs
Economy blogs
Freelancing blogs
Leadership blogs
Productivity blogs
Work blogs

Society

Basic income blogs
Education blogs
Environment blogs
Media blogs
Philosophy blogs
Women blogs
About us |  Write for us |  Terms and conditions |  Contact us

© 2021 SRCRAFT INIDA