Help - Creating a query using specific colums
Posted: Fri Sep 02, 2005 8:19 am
Hi,
I need to create a query taking specific colum data (IP, IP1, IP2, IP3 etc.) within my database however I do not know how to do this. Here is my code so far and explainations;
I will eventually output the data using an echo statement.
As always, any help would be greatly appreciated.
I need to create a query taking specific colum data (IP, IP1, IP2, IP3 etc.) within my database however I do not know how to do this. Here is my code so far and explainations;
Code: Select all
$db = mysql_connect("localhost","","") or die("Problem connecting");
mysql_select_db("audit") or die("Problem selecting database");
$ips = //this sets the variable to all of the IP colums withi nthe database
$query = "SELECT '$ips' FROM dedicated"; //$query looks through the ips
$result = mysql_query($query) or die ("Query failed"); //$result holds all of the found IP addresses
$numofrows = mysql_num_rows($result); //Counts number of rows from $resultI will eventually output the data using an echo statement.
As always, any help would be greatly appreciated.