All pastes #534110 Raw Edit

hak5fan

public php v1 · immutable
·published 2007-06-03 17:45 UTC
rendered paste body
<?php 	require("databaselogin.php"); // Log on to the database. 	$sql = "SELECT `*` FROM `guide`"	$guideinnhold = mysql_query($sql); // Get all the info needed from the database guide and store it in guideinnhold	$guidenr = mysql_num_rows($guideinnhold);	if (!$result) {		echo "Could not successfully run query ($sql) from DB: " . mysql_error();		exit;	}	if($guidenr > 0){		echo "<select>";	}	while ($row_guideinnhold = mysql_fetch_assoc($guideinnhold)) { 				echo"<option value=\""; 		echo $row_guideinnhold['gnr'];		echo "\">";		echo $row_guideinnhold['navn'];          // This block of code prints the select box with all the guide names and id's 		echo "</option>";		echo "\n";	}  	if($guidenr > 0){		echo "</select>";	}	echo $guidenr; // Print the contents of the variable guidenr to the screen to check it's contents. it's empty!?>