Jump to content

[SOLVED] insert query


leest

Recommended Posts

I have some info i am trying to add to my database but it just keeps returning the following error: Error insert query failed.

I have tried writing this query many different ways but fet the same answer, any suggestions would be appreciated.

 

Thanks

 


$query = "INSERT INTO dashboard_component (dashboard_component_id, module_name, module_parameters, site_id, column_number, position) VALUES 

(13, 'text', 'Welcome', '((USERNAME))!\r\nDate: ((DATE))\r\nTime: ((TIME))', '$site_id', 0, 1)";

mysql_query($query) or die('Error, insert query failed');

 

 

Link to comment
https://forums.phpfreaks.com/topic/115820-solved-insert-query/
Share on other sites

ok, Thanks for that, another stupid mistake, i had a mismatch in column numbers all fixed now thanks, but now i have another problem

i need this part of the insert script  to have " " around it like so:

 


$query = "INSERT INTO dashboard_component (dashboard_component_id, module_name, module_parameters, site_id, column_number, position) VALUES 

(13, 'text', 'Welcome', '"((USERNAME))!\r\nDate: ((DATE))\r\nTime: ((TIME))"', '$site_id', 0, 1)";

mysql_query($query) or die('Error, insert query failed');

 

however when i write it like this it just gets binned and shows a blank page, when i take them out it works fine.  I need to add the "" so the info is formated for when it is read from the database table and then displays the username.

 

Does any body have any ideas or suggestions

Link to comment
https://forums.phpfreaks.com/topic/115820-solved-insert-query/#findComment-595459
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.