hi i need a help for php my sql

erandap

Active member
  • Jun 11, 2008
    317
    30
    28
    Hay, I also need a help for PHP.
    How i start to develop web page with php? what are the software do i need to install? what are the API for it?
     

    imeshSJ

    Member
    Jul 26, 2007
    872
    12
    0
    this is my prob
    ". i want to change this code to uypload 5 images
    pls help me

    <?php

    //This is the directory where images will be saved
    $target = "images/";
    $target = $target . basename( $_FILES['photo']['name']);

    //This gets all the other information from the form
    $name=$_POST['xx'];
    $address=$_POST['xx'];
    $phone=$_POST['xx'];
    $email=$_POST['xxl'];
    $mobile=$_POST['xx'];
    $type=$_POST['xx'];
    $bedrooms=$_POST['xx'];
    $bathrooms=$_POST['xx'];
    $furnish=$_POST['fxx'];
    $pic=($_FILES['photo']['xx']);

    // Connects to your Database
    mysql_connect("xxxx", "xxxxx", "xxxxxx") or die(mysql_error()) ;
    mysql_select_db("navaja") or die(mysql_error()) ;

    //Writes the information to the database
    mysql_query("INSERT INTO `xxxx` VALUES ('$name', '$address', '$phone', '$email', '$mobile', '$type', '$bedrooms', '$bathrooms', '$furnish', '$pic')") ;

    //Writes the photo to the server
    if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))
    {

    //Tells you if its all ok
    echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
    }
    else {

    //Gives and error if its not
    echo "Sorry, there was a problem uploading your file.";
    }
    ?>
    </body>
    </html>"
     

    imeshSJ

    Member
    Jul 26, 2007
    872
    12
    0
    meke thiyenne 1 photo ekak.mata onne photo 5 withara upload karala epa sql eke write wennath onne
    pls help me
     

    agarp

    Member
    Aug 21, 2008
    327
    1
    0
    Hay, I also need a help for PHP.
    How i start to develop web page with php? what are the software do i need to install? what are the API for it?
    there is a software called xampp download that and install also install mysql
    then there is a software called php admin if you want can instal that also.
     

    agarp

    Member
    Aug 21, 2008
    327
    1
    0
    to add five images
    $pic1=($_FILES['photo']['p1']);
    $pic2=($_FILES['photo']['p2']);
    $pic3=($_FILES['photo']['p3']);
    $pic4=($_FILES['photo']['p4']);
    $pic5=($_FILES['photo']['p5']);


    //Writes the information to the database
    mysql_query("INSERT INTO `xxxx` VALUES ('$name', '$address', '$phone', '$email', '$mobile', '$type', '$bedrooms', '$bathrooms', '$furnish', '$pic1', '$pic2', '$pic3', '$pic4', '$pic5')") ;

    create the database proberly to add five images also change all the xxx if you get prob pm me