# What am i doing wrong here (php mysql query)

**URL:** https://forum.kirupa.com/t/what-am-i-doing-wrong-here-php-mysql-query/311320
**Category:** Uncategorized
**Created:** [July 2, 2010, 5:26pm UTC](https://forum.kirupa.com/t/what-am-i-doing-wrong-here-php-mysql-query/311320 "2010-07-02T17:26:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)
#### Post date: [July 2, 2010, 5:26pm UTC](https://forum.kirupa.com/t/what-am-i-doing-wrong-here-php-mysql-query/311320/1 "2010-07-02T17:26:31Z")

</div>

can’t seem to figure this one out…  
just trying to get num rows on query result and see if a match exists or not…

```auto
<?php

require_once('connVars.php');

$title = $_POST['titl'];

$data = mysql_query("SELECT * FROM entries WHERE entryName LIKE '$titl'")
or die(mysql_error());

$rows=(mysql_num_rows($data))
if($rows > 0)
{
$reply = "&reply=exists";
echo $reply
}else{
$reply = "&reply=nonexistent";
echo $reply;
}

?>

```
