|
-
May 22nd, 2010, 04:03 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] my first php page
hi all
i have a web page im working on, my first php page ever and im stuck with pictures
i want to add a picture to ever row of my search on the db
the picture is store under the localhost server but i cant get it to work. example below
PHP Code:
<img border=0img src="//localhost/vidpics/videotitle.jpg" width=40 height=40>
on the image bit i need tobe able to use localhost not servers name and the image title(videotitle) needs to be able to change to each row.
PHP Code:
<?php
/* Change next two lines */
$db="vdidb";
$link = mysql_connect('localhost: 3306', 'user', 'password');
if (! $link)
die(mysql_error());
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
// $result = mysql_query( "SELECT vidnumber, videotitle, age, Runningtime, starring, hd, trilogy FROM videolist")
$id = "%".$_GET["search"]."%";
// $result = mysql_query( "SELECT vidnumber, videotitle, age, Runningtime, werestoredFolder FROM videolist WHERE videotitle LIKE '".mysql_real_escape_string($id)."'")
$result = mysql_query( "SELECT vidnumber, videotitle, age, Runningtime FROM videolist WHERE vidnumber LIKE '".mysql_real_escape_string($id)."'")
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
// print "There are $num_rows records.<P>";
print "<table width=200 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td>$field</td>\n";
print "</tr>\n";
}
print "</table>\n";
print "There are $num_rows records.<P>";
mysql_close($link);
?>
<br>
<body>
programming pc: laptop. running xp pro and vb.net..
media centre xp pc: dual core 6000,4gb memory, 1tb harddrive
mainserver: server 2008, 8gb memory, amd e-350 dual core, 6tb harddrive and local web host
atomvault 1: server 2008, atom 330 with 4 gb memory, 35TB hardrive space for videos and music..
backup pc : xp, 4gb, atom 330, 10tb harddrive(web, pictures, music, databases)
2 x video backup: atom 330, 2gb, 18tb harddrive
everything on remote login..
check out my builds http://AtomVaults.yolasite.com
learning vb.net and php + mysql   - got most of the basics now.
I WISH THERE WAS MORE TIME IN THE DAY  
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|