image problem

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
DivaX007
Guest





PostPosted: Tue Nov 12, 2002 10:34 pm    Post subject: image problem Reply with quote

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

PostPosted: Tue Nov 12, 2002 11:25 pm    Post subject: Re: image problem Reply with quote

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 View user's profile Send private message Send e-mail
DivaX007
Guest





PostPosted: Thu Nov 14, 2002 10:26 pm    Post subject: Reply with quote

[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

PostPosted: Fri Nov 15, 2002 12:09 am    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group