Variable
Posted: Fri Feb 18, 2005 12:11 pm
I am a bit of a newbie to php.
I want to insert a php script into a php file so that when I want to call it up all I have to do is enter the variable.
Please could someone make this script so that all I have to do is enter it in the page and I can call up the variable.
Heres the code I want to call up.
I want to insert a php script into a php file so that when I want to call it up all I have to do is enter the variable.
Please could someone make this script so that all I have to do is enter it in the page and I can call up the variable.
Heres the code I want to call up.
Code: Select all
<?php
$location = "localhost";
$username = "hillclim";
$password = "XIxIMeulOO";
$database = "hillclim";
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
$query = "SELECT * FROM xmb_members";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
while($row = mysql_fetch_array($result)){
echo "<br>$rowїsite]";
}
?>