Hello
Im trying to upload and then display images from a mysql database - Its only basic and i only need one pic per user on the database hence why using mysql
I really need osme help as ive been going round in circles for a couple of days now - I know its probably very simple but my head is spinning - any help would be amazing - Be very gratefull
The database has blob specified for the pic
Here is my post data
  <form id="form1" method="post" action="djregistercheck.php" enctype="multipart/form-data">
  <p>
<label>Dj Name
 <input type="text" name="DJName" id="DJName" />
  </label> * - Must Be Entered
  </p>
  <p>
    <label>Your Email
    <input type="text" name="Email" id="Email" />
    </label>* - Must Be Valid Email Address
  </p>
     <p>
    <label>Password
    <input type="password" name="Password" id="Password" />
</label>* - Must be more than 6 charachters
  </p>
   <p>
    <label>Name
    <input type="text" name="Name" id="Name" />
</label>
    * - Must Be Entered  </p>
      <p>
    <label>Surname
    <input type="text" name="Name" id="Name" />
</label>
    * - Must Be Entered  </p>
<p>
<label>Description
 <input type="text" name="Description" id="Description" />
  </label> * - Must Be Entered
  </p>
    <p>
<label>Expierience
 <input type="text" name="Expierience" id="Expierience" />
  </label> * - Must Be Entered
  </p>
  <p>
 <label>Website
 <input type="text" name="Website" id="Website" />
  </label> * - Must Be Entered
  </p> 
    <p>
 <label>Location
 <input type="text" name="Location" id="Location" />
  </label> * - Must Be Entered  </p>
      <p>
 <label>Mobilephone
 <input type="text" name="Mobilephone" id="Mobilephone" />
  </label> * - Must Be Entered
  </p>
        <p>
 <label>Picture
 <input type="file" name="Pic" size="50" id="Pic" />
  </label> * - Must Be Entered
  </p>
      <p>
    <input type="submit" name="button" id="button" value="Submit" />
  </p>
</form>
and here is the djregistercheck page
<?php 
include 'connection.php'; 
// Main ---------- 
session_start(); 
   // Get the data collected from the user 
    $DJName = $_POST['DJName'];  
   $Email = $_POST['Email'];
   $Password = $_POST['Password'];
   $Name = $_POST['Name']; 
   $Surname = $_POST['Surname'];   
   $Description = $_POST['Description'];
   $Expierience = $_POST['Expierience'];
   $Website = $_POST['Website'];
   $Location = $_POST['Location'];
   $Mobilephone = $_POST['Mobilephone'];
   $Pic = $_POST['Pic'];
   if (empty($Email)) 
    { 
     $_SESSION["message"] = "Email Address is Empty - Please re-enter" ; 
       header("Location: djregister.php"); 
       exit; //Ends the script and redirects to above 
 } 
 //Check to see if the email contains '@' 
 else if (strpos($Email,'@') < 1) 
 { 
  $_SESSION["message"] = "Email Address is Invalid - Please re-enter" ; 
       header("Location: djregister.php"); 
   exit; //Ends the script and redirects to above
      }
//Checks to see if the password is less than 6 charachters 
 else if (strlen($Password)<6) 
 { 
  $_SESSION["message"] = "Password must be longer than 6 charachters" ; 
       header("Location: djregister.php"); 
       exit; //Ends the script and redirects to above } 
      }
 //All was OK - Log details to Customer Database and re-direct to login so customer can now login 
 else 
 $query = "INSERT INTO Dj (DJName, Email, Password, Name, Surname, Description, Expierience, Website, Location, Mobilephone, Pic) VALUES ('$DJName', '$Email', '$Password', '$Name', '$Surname', '$Description', '$Expierience', '$Website', '$Location', '$Mobilephone', '$Pic')";   
 $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());  
 
$_SESSION["message"] = "Thank You $DJName For Registering - Please now log in to View Site" ;  
header("Location: login.php"); //This sets the redirection information 
exit; //Ends the script and redirects to above 
     // execute query
      
   // print $query; 
   
    $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());  
// close connection 
mysql_close($connection);    
?>
 
So im not sure if that works correctley but i presume it does as when i do the below a file path is displayed
Here is the code for the display
//Include the connection details, open $connection and select database 
include ("connection.php"); 
//Prepare query 
$query = "SELECT DJName, Email, Description, Expierience, Website, Pic
         FROM Dj";
        
// execute query  
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());  
// see if any rows were returned 
if (mysql_num_rows($result)>0) { 
    echo "<table border=1>n<tr>" . 
              "<th>DJName</th>" . 
              "<th>Email</th>" . 
           "<th>Description</th>" .
           "<th>Expierience</th>" .
           "<th>Website</th>".
           "<th>Pic</th>";    
    while ($row = @ mysql_fetch_array($result)) {
    //while($row = mysql_fetch_row($result)) { 
      echo "<tr>"; 
        echo "<td class=BorderMeRed>".$row["DJName"]."</td>"; 
        echo "<td class=BorderMeRed>".$row["Email"]."</td>";
        echo "<td class=BorderMeRed>".$row["Description"]."</td>"; 
      echo "<td class=BorderMeRed>".$row["Expierience"]."</td>";
      echo "<td class=BorderMeRed>".$row["Website"]."</td>";
      echo "<td class=BorderMeRed>".$row["Pic"]."</td>";  
        echo "</tr>"; 
    } 
    echo "</table>"; 
}  
else {  
    // no  
    // print status message  
    print "No rows found!";  
}  
?>  
					
					
					
email CODING Problem
Email coding problem.I need to send a section of the info to $tf and the same as a Cc to $email and also I need the full info to be sent to my@mail.com. how to do that?summery:only selected Info: name
Disable Scrollbar in TableControl
Hello everbody,
Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i was trying to make a Image gallery for just that particular user who had uploaded those images. i am
Delete HTML file after loading
I have limited experience with php and its been a year or two since I've last used it. I have a small web application where I want to make sure the data presented on a page (currently an HTML file)
BB_Code error
I'm having a problem with a custom built function and keep getting this error:Warning: Missing argument 1 for BB_Code::BB_Code(), called in /home/cra10002/public_html/mooglebook/input.php on line 21
php call servlet
I have done a php backup application .So there is a form that user pick some files to zip and download.Because of a problem with greek characters I make a servet (java) to create the zip.But I want
Insert data in Mysql and move to another page
I'm stuck with this simple problem. I need to insert data in Mysql and then hit submit and move to another page. My first thougt was to use Post but that didn't work. How do I use Get and Post to do
PHP & MS Access - Line Break
Hey Guys!I'm pulling records from an MS Access database and listing them using PHP and I'm running into an error that I can't seem to figure out.Please see the code below:Code: if
How to file_get_contents when login required?
Hello!I am trying to read data from a page that you have to be logged into to view, I am trying to use file_get_contents to do this, I have read that I need to use cURL, Is that true?Also, as Another
xml element exists
Code: [Select]<?xml version="1.0"?><Addresses> <Address ID="1"> <Address2>101 MAIN ST</Address2>