Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
    $img1 = $_GET['img1'];
    $img2 = $_GET['img2'];
    $query = $mysql_query("SELECT * FROM asd WHERE ID=$img1");
    $row1 = mysql_fetch_array($query);
    $query = $mysql_query("SELECT * FROM asd WHERE ID=$img2");
    $row2 = mysql_fetch_array($query);

--

Was having trouble with this, forgot to exclude $

share|improve this question
1  
Would you restore the original version? That way it may help someone else in the future. As it stands, it is only good for closing. –  George Cummins Nov 23 '13 at 0:13
 
Yup, done ..... –  user3021438 Nov 23 '13 at 0:19
add comment

closed as off-topic by George Cummins, Jim Lewis, Salvador Dali, andrewsi, JqueryLearner Nov 23 '13 at 4:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance." – George Cummins, Jim Lewis, Salvador Dali, JqueryLearner
If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 2 down vote accepted

The problem is here:

$query = $mysql_query("SELECT * FROM asd WHERE ID=$img1");

and here:

$query = $mysql_query("SELECT * FROM asd WHERE ID=$img2");

Remove the '$' before mysql_query(...);

share|improve this answer
 
awww goddamit, thank you! –  user3021438 Nov 23 '13 at 0:11
 
Sleep coding: it happens to us all. –  George Cummins Nov 23 '13 at 0:12
add comment

You are referencing mysql_query as a variable by prefixing it with the '$'. try removing the dollar to call the mysql_query function.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.