# Can Anyone Tell Me What I Did Wrong?

**URL:** https://forum.kirupa.com/t/can-anyone-tell-me-what-i-did-wrong/306926
**Category:** programming
**Created:** [March 24, 2010, 5:40pm UTC](https://forum.kirupa.com/t/can-anyone-tell-me-what-i-did-wrong/306926 "2010-03-24T17:40:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ximenao](https://avatars.discourse-cdn.com/v4/letter/x/eada6e/32.png) [@Ximenao](https://forum.kirupa.com/u/Ximenao)
#### Post date: [March 24, 2010, 5:40pm UTC](https://forum.kirupa.com/t/can-anyone-tell-me-what-i-did-wrong/306926/1 "2010-03-24T17:40:09Z")

</div>

I’m please asking for help with this mysql\_query error I keep getting.  
I’ve coded an online examination where if a person enters text resembling the statements stored in the database, points will be added. Following is the main part of this code:

```auto
$sql1 = mysql_query("SELECT * FROM formone_ex1_secthreesr WHERE MATCH (q1) AGAINST ($uno)");

        $result1 = MySQL_query($sql1) or die(mysql_error());

//if results have been found add two points!
while($r1=mysql_fetch_array($result1))
{	
   
  
   $q1=$r1["q1"];

	$a = 2;
} 

//if no results have been found this function adds zero points! 
if (!$q1) 
{ 
$a = 0; 
} 
//end 

$sql2 = mysql_query("SELECT * FROM formone_ex1_secthreesr WHERE MATCH (q1) AGAINST ($dos)");

        $result2 = MySQL_query($sql2) or die(mysql_error());

//if results have been found add two points!
while($r2=mysql_fetch_array($result2))
{	
   
  
   $q2=$r2["q1"];

$b = 2;
} 

//if no results have been found this function adds zero points!
if (!$q2) 
{ 
$b = 0; 
}

```

Yet when I use this code, I get the error “Query was empty”.  
I know this means my query is failing, but where?!  
I really can’t see why it is, it looks fine to me…
