Jump to content

[SOLVED] defining $sql


slanderman

Recommended Posts

I'm trying to get this query from my webform to work.  I noticed that the code I borrowed doesnt define / set $sql...how do I set this to make the query work?  When i try to query the database, I keep getting "Error: Query was empty"

 

<?php

$con = mysql_connect(......);
if (!$con)
{
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("slanderman", $con);

$result = mysql("slanderman","SELECT * FROM performer WHERE (firstname LIKE '%"+$Search + "%' OR lastname LIKE '%"+$Search + "%' OR email LIKE '%"+$Search + "%') ORDER BY firstname,lastname,email");

if (!mysql_query($sql,$con))
  {
die('Error: ' . mysql_error());
  }

mysql_close($con);

?>

Link to comment
https://forums.phpfreaks.com/topic/178375-solved-defining-sql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.