![]() |
Variables not writing to db
Hey guys... I've finally been able to get some time to play around with php a bit. I've hit a bit of a blank wall though, and was hoping someone could point out my obvious blunder. Taking into consideration the code below (I'm building it in stages, so it's not secure yet with regards to mysqli_real_escape_string), I am not able to write the variable value into the database. I've tried a few variations of the code, but still nothing. If I change the variable value to a normal string value, it inserts it without a prob. The code gives no errors either, so I'm a little confused :-/
PHP Code:
|
Hi David,
Does it give any errors at all? If not, can you put an " or die(mysqli_error());" after your mysqli_query() - that may give us a clue to where it's going wrong :-) Alan |
It's now giving me an 'unknown column in fields list' error... Which means its associating my input with the field and not the value :-/ Any idea why? The sprintf looks right to me, so does the sql.
|
Ah, never mind... I forgot to add in the inverted commas in the sprintf... *!*
PHP Code:
|
Cool cool, glad you got it fixed :-)
Alan |
| All times are GMT. The time now is 09:38 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0