mysql_connect("$host"- "$username"- "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
////////////////////////////////////////////////////
$result = mysql_query("SELECT * FROM weapon ORDER BY name");
while($row = mysql_fetch_array($result)){
echo "<tr>";
//start row
echo "<td>";
echo "<a href=\"weapon2.php?id=";
echo $row["id"];
echo "\">";
echo $row["name"];
echo "</a>";
echo "</td>\n";
echo "<td>";
echo $row["member"];
echo "</td>\n";
echo "<td>";
echo $row["requirement"];
echo "</td>\n";
echo "<td>";
echo $row["type"];
echo "</td>\n";
//end row
echo "</tr>";
}
However there are too many results and i want to display them in pages like each page i get only 8 results.
Please help and assist
Thanks guys the Limit thing works
i dunno who to choose best answer... well lets just take the first 1 ( i love panda )
O its not a panda.. its a piglike rat or something
My setup is;
Apache -Mysql and activeperl.
I want to move (not copy) images from one folder to another.
The current script i tried using COPIED the image; and the image in the new folder had 0 bytes!
i m currently looking for a Flash MX tutorials...i wanted a PDF format Ebook coz I don t have an internet connection at home and I don t have the time to go rent in a computer shop...
i m also looking for tutorials about
1. Java
2. Dreamweaver
3. photoshop
4. VB.NET
5. HTML
6. MYSQL
7. PHP
8. CSS
9. ASP
if you can give me a link with all those topics that will be great- too...
i need a search engine for my newly built mySQL database. Any good open source code out there for me?
thank you very much.
<?php
$id=$_REQUEST[ id ];
$conn=mysql_connect("localhost"-"root"-"");
mysql_select_db("neelima"-$conn)or die( could not connect );
if(isset($_POST[ add ]))
{
$name =$_REQUEST[ name ];
$id=$_REQUEST[ hid_id ];
$age=$_REQUEST[ age ];
$place=$_REQUEST[ place ];
$graduation=$_REQUEST[ graduation ];
$percentage=$_REQUEST[ percentage ];
$query = "SELECT * FROM `db_address` WHERE name=$name";
$result = mysql_query($query);
$num_of_rows = mysql_num_rows($query);
if($num_of_rows == 0)
{
$query = "INSERT INTO `db_address`(name-age-place-graduation-percentage) VALUES( $name - $age - $place - $graduation - $percentage )";
$result = mysql_query($query);
header("location:address1.php?id=$id");
}
else if($num_of_rows > 0)
{
echo "ALREADY EXISTS";
}
}
?>
<form action="add_address1.php" method="post">
<table border="2" bgcolor="#FFFFCC" align="center">
<input type="text" name="hid_id" value="<? echo $id;?>">
<tr><td>name</td><td><input type="text" name="name" value="<? echo $name;?>"></td></tr>
<tr><td>age</td><td><input type="text" name="age" value="<? echo $age;?>"></td></tr>
<tr><td>place</td><td><input type="text" name="place" value="<? echo $place;?>"></td></tr>
<tr><td>graduation</td><td><input type="text" name="graduation" value="<? echo $graduation;?>"></td></tr>
<tr><td>percentage</td><td><input type="text" name="percentage" value="<? echo $percentage;?>"></td>
<tr><td><input type="submit" name="add" value="add"></td></tr>
</table>
</form>
</html>
I m so fed up with sessions. The exact same code will not work on certain version and work on certain version of php. To me- sessions dont seem very reliable.
What do u guys think of something like this?
Whenever user logs in:
mysql_query("UPDATE members SET session= online WHERE username= $username AND password= $password ");
whenever user logs out
mysql_query("UPDATE members SET session= offline WHERE username= $username AND password= $password ");
input will be appreciated
No comments:
Post a Comment