ccnaboy_2000 Posted March 27, 2007 Share Posted March 27, 2007 $query = "INSERT INTO repository (url) VALUES ('".$link."')"; print $query. "<br /><br />"; mysql_query($query) or die("cannot execute query"); This is what it prints INSERT INTO repository (url) VALUES ('http://ezinearticles.com/ssp/ezinearticles.xml') cannot execute query The $query value doesnt look bad? Whats wrong with the query? Quote Link to comment https://forums.phpfreaks.com/topic/44441-solved-failure-on-query/ Share on other sites More sharing options...
marknt Posted March 27, 2007 Share Posted March 27, 2007 try this mysql_query($query) or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/44441-solved-failure-on-query/#findComment-215828 Share on other sites More sharing options...
HoTDaWg Posted March 27, 2007 Share Posted March 27, 2007 <?php $query = "INSERT INTO repository VALUES ('".$link."')"; mysql_query($query,$yourlinktoyourconnection) or die(mysql_error()); ?> - here is the proper format in my opinion - you can not echo anything since insert will insert, to echo you will need to use the SELECT statement:) - heres a good tutorial on the select statement http://www.php-mysql-tutorial.com/php-mysql-select.php Quote Link to comment https://forums.phpfreaks.com/topic/44441-solved-failure-on-query/#findComment-215829 Share on other sites More sharing options...
Waldir Posted March 27, 2007 Share Posted March 27, 2007 try $query = "INSERT INTO repository (url) VALUES ('".$link."')"; print $query. "<br /><br />"; mysql_query($query) or die(mysql_error()); and post your error Quote Link to comment https://forums.phpfreaks.com/topic/44441-solved-failure-on-query/#findComment-215830 Share on other sites More sharing options...
ccnaboy_2000 Posted March 27, 2007 Author Share Posted March 27, 2007 well the echo was not a part of the $query variable that is passed to mysql_query. it was more for debugging the $query variable to make sure it had the correct data in it. Quote Link to comment https://forums.phpfreaks.com/topic/44441-solved-failure-on-query/#findComment-215831 Share on other sites More sharing options...
ccnaboy_2000 Posted March 27, 2007 Author Share Posted March 27, 2007 thanks guys I figured it out. I created the column with the wrong type. =D Quote Link to comment https://forums.phpfreaks.com/topic/44441-solved-failure-on-query/#findComment-215832 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.