I need to get images from a database and heres how I do it
<?php
//Database-Table-Name
$db_table="index";
//image path
$the_path="images";
include "global.php";
$handler=@mysql_connect($db_server,$db_username,$db_passwort);
@mysql_select_db($db_database,$handler);
$result=@mysql_query(("SELECT * FROM $db_table WHERE imgid = '$id'"),$handler);
while(($row=mysql_fetch_array($result)))
{
$name=$row["imgname"];
$filename="$the_path/$name";
}
//Displaying the image...
//echo "<img src=http://www.phpbuilder.com/board/archive/index.php/$filename><br>";
?>
Lets say I have on table named images. i want to get all the images with a id number of 1 from there and place them in different areas of a page. How would I be able to do that?
<?php
//Database-Table-Name
$db_table="index";
//image path
$the_path="images";
include "global.php";
$handler=@mysql_connect($db_server,$db_username,$db_passwort);
@mysql_select_db($db_database,$handler);
$result=@mysql_query(("SELECT * FROM $db_table WHERE imgid = '$id'"),$handler);
while(($row=mysql_fetch_array($result)))
{
$name=$row["imgname"];
$filename="$the_path/$name";
}
//Displaying the image...
//echo "<img src=http://www.phpbuilder.com/board/archive/index.php/$filename><br>";
?>
Lets say I have on table named images. i want to get all the images with a id number of 1 from there and place them in different areas of a page. How would I be able to do that?