-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show how to INSERT? #19
Comments
|
@AlexMerser21 this is utterly wrong example. Either run INSERT query the same way as other queries:
Or create an array with key-value pairs for all the variable values, and then use ?u placeholder:
|
@colshrapnel но чем плохо такое использование? Я в пхп недавно и всегда писал свои приложение именно вот так. Пожалуйста распишите, если не сложно Да и в CRUD приложение написано так-же http://phpfaq.ru/crud |
In your example some variables were going into query as is - without any formatting. |
@colshrapnel How to get last inserted id in this case? |
just use the
|
When using ?u with an array containing false value, the value becomes empty string on insert. e.g.
The field myvalue is tinyint(1) DEFAULT NULL (BOOLEAN) |
@Perlovka indeed ?u doesn't work with STRICT MODE.
You can still insert other values using ?u:
In case this field have to be added dynamically, then you have to resort to ?p method
This is the most inconvenient method but it's all safemysql can do in this case. |
Thanks, i just wondered if it's so by design, int is ok for me ) |
Can you please add a full CRUD example.
And why not make it use PDO instead?
The text was updated successfully, but these errors were encountered: