Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Posts posted by techker

  1. hey guys so i got this going but there sum is wrong??

     

    $query2 = "SELECT COUNT( `to_t1` )-( `from_t1`)AS TotalNumber, SUM( `to_t1` )-( `from_t1`) AS Totalhours FROM `week1`; "; 
    $result2 = mysql_query($query2) or die(mysql_error());
    
    while($row = mysql_fetch_array($result2)) {
    
      echo $row['Totalhours'] ." H";
    }
    

    21H

     

    to_t1 is 17:30 and from_t1 is 9:30

     

    how does it get 21?i need 8h

     

  2. problem..

     

    every thing is working fine now..the only thing is that in my table time, i created field from_m1,from_m2..that represents from..

     

    and 7 more to_m1,to_m2.. that represents the to in the days..

     

    so i have this monday input filed(from_m1) to  input filed(to_m1)

     

    now if i have more then one entry it screws up cause it show both.

     

    i need to assosiate monday to form_m1 and to_m1 and tuesday to form_m2 and to _m2......

     

    i make one table week 1 and put the fields in that one.

     

    so the second time would go in week 2.....

     

    the only thing is for that to be associated ?(guess something like a drop down menu with week 1 week2 week 3 week 4 week 5..)

     

    the place that i would jam is how to determine if he selected week 1 to insert the data in that table..

  3. ya but what would be the php formula?cause lets say i make a database with monday input filed from to input field and it puts it in the database.

     

    to pull it out

     

    SELECT COUNT( `time` ) AS TotalNumber, SUM( `time` ) AS TotalPrice FROM `fc`; 

  4. sorry the cell name

     

    i put this it works put the space between the pics is to mutch?

     

    div.thumb {

      float: vertical;

      width: 25%;

      border: thin silver solid;

      margin: 0.5em;

      padding: 0.5em;

    }

  5. hey guy im making a car website for my buddy and i have a featured cars on the front page.

     

    now in my database i added a field featured

     

    im using this

     

    SELECT * FROM db WHERE featured ORDER BY RAND()

     

    on my page i added 4 boxes with code

     

    but i replicates it 4 times each featured car..all i one is 4 diffrent featured cars...

  6. ok so i change it to

     

    mysql_query("INSERT INTO `employees`( name, email,phone,photo,thumb,numero,description,pics,pics2,kilometers,year) VALUES ('$name', '$email','$phone','$pic','$thumb','$num','$desc','$pics','$pics2','$kilo','$year')") ;

    mysql_query($query) or die('Error, add album failed : ' . mysql_error());

     

    and get Error, add album failed : Query was empty

  7. hey guythis script was working fine yesturday and now..nothing..

     

    it insert data from a form in my mysql db

     

    can sombody see if they can see a mistake in here..cause i played arround with it..lol

     

    <?php
    $target = "./";
    $target2= "./";
    $target3= "./";
    $target = $target . basename( $_FILES['photo']['name']);
    $target2 = $target2 . basename( $_FILES['thumb']['name']);
    $target3 = $target3 . basename( $_FILES['pics']['name']);
    $target4 = $target4 . basename( $_FILES['pics2']['name']);
    
    $name=$_POST['name'];
    $email=$_POST['email'];
    $phone=$_POST['phone'];
    $pic=($_FILES['photo']['name']);
    $thumb=($_FILES['thumb']['name']);
    $num=$_POST['numero'];
    $desc=$_POST['description'];
    $pics=($_FILES['pics']['name']);
    $pics2=($_FILES['pics2']['name']);
    $kilo=$_POST['kilometers'];
    $year=$_POST['year'];
    
    
    // Connects to your Database
    mysql_connect("localhost", "canadaau_", "") or die(mysql_error()) ;
    mysql_select_db("canadaau_") or die(mysql_error()) ;
    
    //Writes the information to the database
    mysql_query("INSERT INTO `employees` VALUES ('$name', '$email', '$phone', '$pic','$num','$desc','$thumb','$pics','$pics2','$kilo','$year')") ;
    
    
    if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))
    
    {
    if(move_uploaded_file($_FILES['thumb']['tmp_name'], $target2))
    
    {
    if(move_uploaded_file($_FILES['pics']['tmp_name'], $target3))
    
    {
    if(move_uploaded_file($_FILES['pics2']['tmp_name'], $target4))
    
    {
    echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
    echo "You'll be redirected to Home Page after (4) Seconds";
             echo "<meta http-equiv=Refresh content=4;url=/ADMIN/index_cpanel.php>";
    }
    else {
    
    
    echo "Sorry, there was a problem uploading your file.";
    }
    }
    }
    }
    ?>

  8. hey guy's im doing a project for my buddy.he is a trainer at my gym and i want to make him a web site with an admin panel for him o do his workout sheets.

     

    it is bassicly a grid and a tone of clipart.every customer is diffrent for exercies..

     

    so the grid stays the same and the box for the image is going to be the same size as the cliparts.

     

    http://www.exrx.net/Store/Other/PhysigrapheSamples.html

     

    so it is to insert the image in the rigth box.or associate the image with the field.

     

    i have to choices ajax or php?right the drag and drop from ajax..but i think php would be easyer..i just need guidance in the wright direction..thx

     

×
×
  • 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.