![]() |
SQL query inserting extra parentheses?
I'm trying to insert some data in the db, but the below query inserts it with parentheses. Any other combination I try, even taking off all parentheses just results in a query error. What am I doing wrong?
Code:
$db->query_read("INSERT INTO picks_groups (group_title) VALUES ('$db->escape_string($event_name)')"); |
To call a function you need to break out of the double quotes like so,
PHP Code:
Another (easier to read / write for some, but not necessarily better) method is this: PHP Code:
|
Thanks, what is the proper way to clean an array inside $_POST? So, $_POST['outcome'][]
|
PHP Code:
|
PHP Code:
|
lol good catch
|
Hehe, i was a bit surprised you did not catch that one, and even copied it to your improved code. :D
|
Thanks, I had caught that yesterday after reading through some of the vBulletin developer tools material. Thanks for that answer Dismounted.
|
All times are GMT. The time now is 02:17 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|