View previous topic :: View next topic |
Author |
Message |
DivaX007 Guest
|
Posted: Tue Nov 12, 2002 10:34 pm Post subject: image problem |
|
|
running win98, abyss web server, php, mysql.
i've attempted to save images in a file folder and the link in mysql:
|id|0
|name|<IMG SRC=http://localhost/UploadPics/car2.gif WIDTH= "160" HEIGHT= "160" BORDER="0">
|rating|0
|rates|0
1.is this correct?
2.Specifically, how do i get the image to display using php?
all help would be appreciated.
thanks in advance |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Tue Nov 12, 2002 11:25 pm Post subject: Re: image problem |
|
|
DivaX007 wrote: | running win98, abyss web server, php, mysql.
i've attempted to save images in a file folder and the link in mysql:
|id|0
|name|<IMG SRC=http://localhost/UploadPics/car2.gif WIDTH= "160" HEIGHT= "160" BORDER="0">
|rating|0
|rates|0
1.is this correct?
2.Specifically, how do i get the image to display using php?
all help would be appreciated.
thanks in advance |
Correct ? Don't really know what do you want to do with the different information you listed so we can't give you an advice.
Displaying an image: Just print appropriate HTML code using PHP to generate for example something like:
<IMG SRC="myimage.gif"> _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
DivaX007 Guest
|
Posted: Thu Nov 14, 2002 10:26 pm Post subject: |
|
|
[not the real user name/password/dbname]
<?php
//connect to mysql database
$dbcnx=@mysql_connect("localhost","clifford","bigreddog");
if (!$dbcnx) {
echo ("Could not connect to mysql server");
exit();
}
//select the Pictures database
if (! @mysql_select_db ("Pictures") ) {
echo ("Could not connect to Pictures database");
exit();
}
//request all images
$result=@mysql_query("SELECT * FROM Pictures WHERE id=0");
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
echo $row['name']; // this will display the image
}
?>
when i run this script, i get this error:
Could not connect to mysql server
[/b] |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Nov 15, 2002 12:09 am Post subject: |
|
|
DivaX007 wrote: | when i run this script, i get this error:
Could not connect to mysql server
|
That means that the script couldn't connect the mysql server. That's self-explanatory.
That means also that either the MySQL connections parmaters were wrong, your database server is inaccessible or that it is down.
You should investigate the possible problems. This has nothing to do with Abyss Web Server and it depends on how your database is setup (and only you known that.) _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|