Results 1 to 2 of 2

Thread: php mysql image name into database

  1. #1
    Join Date
    Mar 2013
    Winnipeg, Canada

    php mysql image name into database

    I am working on a php file for school. We have to take a form and add first name, last name, email and a photo to a database. I am able to add the names, email to the database but am unable to add the image name to the database. Here is part of the php code and some of the html. If someone can please take a look and give some help. Many thanks in advance.

    <?php include("db_connect.php");?>
    <?php // select the database in which to add a table

    $sql ="INSERT INTO drivers_0115061 (ln,fn,month,day,year,photo,email)
    VALUES ('".$_POST["ln"]."',

    //$sql="INSERT INTO people (fn,ln,dob,city,prov,pc,gender,hc,nod) VALUES ('steve','douglas',1234567,'winnipeg','manitoba','r3p 6g5','m','grey',2)";

    //echo $sql;

    mysql_query($sql, $con);
    echo mysql_error();

    <?php include("db_close.php");?>

    <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>
    <input type="file" id="photo" name="photo"/>

  2. #2
    Join Date
    Aug 2004
    Start by looking at this "sticky" post at the top of this forum: http://www.webdeveloper.com/forum/sh...ages-using-PHP
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles