php coding for sql

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    php coding for sql

    HI.... I have a excel file with five coumns named as Sl..No Name ,Age, Sex, and Photo...
    In the columns of Sl.No,Name,Age,Sex have datas and the photos in separate folder named as "photos" with each file named as "Name" ...

    Here I want a page like in A4 size print with print button:


    Sl.No: (drop down box with list of Sl.No)

    Name :

    Age :

    Sex: Photo: (here the particular photo)


    Print


    I hope , I made it understand to you... Thank You ...

    #2
    Have you attempted scripting this yourself?

    Comment


      #3
      Originally posted by something else View Post
      Have you attempted scripting this yourself?


      I tried like this for data... but I struck in photos.. How do I connect them with sql and how do relate with my db table... please guide Me... and thank 4 for your reply..

      My searc.php code

      PHP Code:
      <?php
      $hostname_php_result_conn 
      "localhost";
      $database_php_result_conn "trail";
      $username_php_result_conn "test";
      $password_php_result_conn "test123";   
      $php_result_conn mysql_connect($hostname_php_result_conn$username_php_result_conn$password_php_result_conn);
      mysql_select_db($database_php_result_conn,$php_result_conn);

      if(isset(
      $_POST['submit'])) {
         
      $roll_no $_POST['roll_no'];
         
         
      $sql1 mysql_query("SELECT Sl FROM marks WHERE Sl = $roll_no");
         
      $row1 mysql_num_rows($sql1);
         
         if(
      $row1 == 0) {
            echo 
      'Error, ID does not exist';
         } else {

      $sql1 mysql_query("SELECT * FROM marks WHERE Sl = $roll_no");
      $row1 mysql_fetch_array($sql1);
      $name $row1['Name'];
      $sex $row1['Sex'];
      $age $row1['Age'];

      echo 
      'Name = '.$name.'<br />
      Sex = '
      .$sex'<br />
      Age = '
      .$age;


      echo
      '<form>
      <input type="button" value="Print Page" onClick="window.print();">
      </form>'
      ;
         }   
      } else {
      ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html>
      <head>
      <title>Search</title>
      </head>
      <body>

      <form action="searc.php" method="post">
      <input name="roll_no" type="text" id="roll_no" />
      <input type="submit" name="submit" value="search" />
      </form>
      </body>
      </html>

      <?php
      }
      ?>

      Comment


        #4
        Attach the file
        Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

        Comment


          #5
          echo '<img src="images/'.$name.'.jpg" alt=""/><br/>';

          Comment


            #6
            Originally posted by kevk3v View Post
            Attach the file
            Here the file attached. Sorry for the delay. I'm out of station. Sorry once again
            Attached Files

            Comment


              #7
              Not that one, the excel file lol do you have to use smarty?
              Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

              Comment


                #8
                Originally posted by kevk3v View Post
                Attach the file

                Here I attach the sample file in .zip (contains images folder,excel file)
                Attached Files

                Comment

                Working...
                X