Ok, so here's my scenario: I have a text file that contains data structered kind of like a database, each line is a different row. One element of the row, column #4, contains a string. I have a table in my database that associates the string with and id number. Using a foreach loop (every line of the file), i am trying to extract that string, run a mysql query, and retrieve the id number from the database. Here is the query from one of the lines of the file (using a php echo statement) [code] SELECT * FROM albums WHERE name = 'Away From the Sun' [/code] See the query? No syntax errors at all. Now, when I execute that query with a mysql_query() function, all goes well. No errors. Now, when i take the resultset from the query and put it into mysql_result, i get and error that says [b]Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in /home/john/public_html/music/upload.php on line 17[/b]. But wait, it gets even better. When i take the above query, and run it through phpMyAdmin, i get the desired result. the id number is returned. What gives? Here is the code of the file: [code] <?php $file = "Music.txt"; $source = file($file); mysql_connect("localhost","john","********************"); mysql_select_db("john_music"); for ($i = 1; $i < count($source); $i++) { $data = explode(" ",$source[$i]); $sql = "SELECT * FROM albums WHERE name = '".$data[3]."'"; $resultset = mysql_query($sql); echo "> > $sql<br />"; echo $resultset."<br />"; echo "> > ".mysql_result($resultset,0,'id')."<br />"; $sql = "INSERT INTO songs VALUES ('','".$data[0]."','".$data[3]."','".$data[10]."','','','')"; echo $sql . ";<br /><br /><br />"; } ?> [/code] and here is the output that i get: [a href=\"http://johnluetke.net/music/upload.php\" target=\"_blank\"]Click For Script Output[/a] What gives?