Jump to content

is it with php ??


doctor_james

Recommended Posts

thanks for your answers .

I dont think they're reserved words since adding prefixes does not work ! Here's my code :

 

$query="INSERT INTO ent(user,title,cat,summary,entire,source,pdf,photo,date,time,comment,status) VALUES ('$user','$title','$cats','$summary','$entire','$source','{$pdf['name']}','{$photo['name']}','$date','$time','$comment','$status')";  

Link to comment
Share on other sites

A good way to take reserved words out of the equation is to escape your field names. I wrote a class that actually generates my query strings for me and does just this. Take notice of the backtick around field names. If you've ever used phpmyadmin you might have noticed that it does this too.

 

$query="INSERT INTO ent(`user`,`title`,`cat`,`summary`,`entire`,`source`,`pdf`,`photo`,`date`,`time`,`comment`,`status`) VALUES ('$user','$title','$cats','$summary','$entire','$source','{$pdf['name']}','{$photo['name']}','$date','$time','$comment','$status')";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.