List:General Discussion« Previous MessageNext Message »
From:Javier Gonzalo Gloria Medina Date:January 5 2002 2:01am
Subject:RE: query
View as plain text  
Hi Nathan :

 Thanks for the help look, I read the php.net manual and use the
mysql_num_rows(); function, and I write down this script, did you think
is good enough.

Thank.


<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php

$db = mysql_connect("localhost", "root");
mysql_select_db("Stsdb",$db);
//$sql = "SELECT * FROM urls where (tipo='bsc') order by nombre asc";	
$result = mysql_query("SELECT * FROM urls where (tipo='bsc') order by
nombre asc"); 
$num_rows = mysql_num_rows($result); 

if ($num_rows==0){
echo "no results from the query";
}
else{ ?>
<? while ($myrow = mysql_fetch_array($result)) {  ?>
 <A  href="<? echo $myrow["URL"]; ?>" target=new_window><? echo
$myrow["Nombre"] ; ?></A>        <div align="right">..:: Edit</div>
<? } ?>
<?
echo "$num_rows Rows\n";
}
?>

</body>
</html>



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Thread
Command Line Editing ModeQuentin Bennett4 Jan
  • Re: Command Line Editing ModeDan Nelson4 Jan
  • Re: Command Line Editing ModeJ├Ârgen Winqvist4 Jan
RE: Command Line Editing ModeFulko Hew4 Jan
  • queryJavier Gonzalo Gloria Medina5 Jan
RE: queryJavier Gonzalo Gloria Medina5 Jan