I have a while loop in PHP which assigned values to the follow variables:
$ptitle $summary $author $playlistfeedurl
I have checked using echos that the rest of code is robust and before they are queried into the mySQL database (local host, MAMP) they are definitely the correct values\;
mysql_query("INSERT INTO youtube_playlists (title,summary,author,playlistfeedurl) VALUES ('$ptitle','$summary','$author','$playlistfeedurl')");
However the first and last row are not going into the database and it is a real head scratcher for me!
Any help much appreciated.
UPDATE: Thanks for your answers!
@Yusif Ali: Thanks for the answer, it hasn’t solved my issue but it will surely help. The output is: 111, so three of my results are inserted but the other two are not.
@Dutchie432: This worked a charm thank you so much! It is really bad luck these values were first and last: When I was looping 50 times I was only recieving 48 results in my table, so I reduced it to 5 results to see what would happen and these 2 results somewhere were 1st and 5th. I thought the fact they were first and last was significant, apparently not!
Make sure your variables don’t contain any apostrophes, and if they do, change the to doubles.
Just do this for each variable before construction the SQL statement: