Jump to content

Please please please help!!!!


jackie11

Recommended Posts

Hi everyone,

I am new to this forum and in fact new to mysql in general (I'm one of those complete novices everyone hates ha ha !!!!). I am having some trouble displaying pictures which I have saved in my db, after  a LOT of research and following advise I have saved the picture in my db as URL's (for example:http://127.0.0.1/jackie/pics/samuel_finlay.jpg)
but I can't seem to get them to display on the page the script I have used is:

<html>
<head><title>Employee Index</title></head>
<body>

<h1><img src="etc/Logo_pic_2.JPG"></h1>

<table cellspacing='10'width="10" font style="font-family: Tahoma;" size="2" >
<tr><td colspan='25'><hr></td></tr>

<td><B>ID</td>
          <td><B>Surname </td>
            <td><B>Forename</td>
            <td><B>Job Title</td>
              <td><B>Office Location</td>
              <td><B>Telephone</td>
                <td><B>Email</td>
                <td><B>Expertise</td>
                  <td><B>Hobbies</td>
                  <td><B>DOB</td>
                  <td><B>Picture</td></B>
                  </table>

<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("employee index") or die(mysql_error());
$query = "SELECT * FROM `employee details`";
$result = mysql_query($query)
or die (mysql_error());

  echo "<table cellspacing='15'>";
  echo "<tr><td colspan='20'><hr></td></tr>";
  while ($row = mysql_fetch_array($result))
  {
    extract($row);
 
      echo "
          <td>$Employee_ID</td>\n
          <td>$Surname</td>\n
            <td>$Forename</td>\n
            <td>$Job_title</td>\n
              <td>$Office_location</td>\n
              <td>$Telephone</td>\n
                <td>$Email</td>\n
                <td>$Expertise</td>\n
                  <td>$Hobbies</td>\n
                  <td>$DOB</td>\n
                    <a href='{$row['url']}'>Click me!</a>";
echo "<img src='{$row['img_url']}' alt='' />";
       
    echo "<tr><td colspan='20'><hr></td></tr>\n";
  }
  echo "</table>\n";
 
?>
</body>
</html>


I am also looking to allow people to upload a picture using a form and saving it to a file on the server whilst saving a url of where it is on the db so it can be displayed in the page above for example. Hope I'm not confusing you all!

I have been working and trolling the net for 3 full days trying to do thisso any help would be most appricated, but please bear in mind I am a novice and currently pregnant (pregnanacy really does affect your brain!!!) so keep it simple.

Hope someone can help

Many Thanks for your time

Jackie
Link to comment
Share on other sites

using your current setup - does the page load end up giving you an error or just not displaying it at all? If it at least shows the page, view the source of the page and look at what the it is spitting out. That should help you narrow it down or post it up here if you can't get it (just the relevant parts). If it gives you an error - tell us that too.
Link to comment
Share on other sites

Hi there

Thanks for your replies, in answering your question yes the page does display and all the fields from the database displays, however the picture does not but just displays a box with red cross, no error messages are displayed.

I know my HTML is not right but I can fix that, I just really want to get the pictures displaying first

Hope this clarifies

Thanks to you all again Jackie
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.