Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. techker

    left join

    wow fast.. will this formula do what i need?cause now im getting zero output from it..
  2. techker

    left join

    last thing..now i get Unknown column 'Techker' in 'where clause' i think it's in my were clause?im missing something no? WHERE OUT.DVD_ID = Location.L_ID AND OUT.Employer = $Account";
  3. techker

    left join

    hey guy i doing a litle script for renting dvd's.. i got the DB OUT for rentals and employee for id of the person renting it.. So on my page account i wan't to list the rented dvd's from the employee need to check the OUT database and the Location database for the movie title and pics.. i got this but i got a syntax error.. $query = "SELECT OUT.Employer,OUT.DVD_ID, Location.L_ID ". "FROM OUT, Location ". "WHERE OUT.DVD_ID = Location.L_ID AND OUT.Employer = $Account"; You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OUT, Location WHERE OUT.DVD_ID = Location.L_ID AND OUT.Employer = techker' at line 1
  4. techker

    CSV insert

    ok thx i will google the phpmyadmin import csv to see..
  5. techker

    CSV insert

    i have to make it.. so on the csv: "product_title","short_description","full_description","QTY","Pirce","image.jpg" in phpmyadmin i seen i can import by csv?would it be faster and easier?
  6. techker

    CSV insert

    So QTY = '".trim(saveToDB($data[3]))."', Prices = '".trim(saveToDB($data[4]))."', Image = '".trim(saveToDB($data[5]))."',
  7. techker

    CSV insert

    how would i read it from the csv? is it this? short_description = '".trim(saveToDB($data[1]))."', full_description = '".trim(saveToDB($data[2]))."'";
  8. techker

    CSV insert

    Ya.for the product i got a few filds.but the script has it in 3 diffrent tables..one for name and details .one fo images and the third for priceand qty...
  9. techker

    CSV insert

    hey guys i have an existing code that inserts from scv to 1 DB. is there a way to add 2 more? cause there is 3 db for the products products(product title-ful and short description) products_images(image file name) products_attribute_values(quantity and price) $csv->file_new_name_body = $filename; $csv->Process(_UPLOAD_DIR_); if (!$csv->processed) { $message .= 'CSV upload error: '.$csv->error; } else { $row = 0; if (($handle = fopen(_UPLOAD_DIR_.$csv->file_dst_name, "r")) !== false) { while (($data = fgetcsv($handle, 1000, ",", '"')) !== false) { $sql = "INSERT INTO ".$TABLES['PRODUCTS']." SET categories_id = ".intval($_REQUEST['categories_id']).", order_id = 0, status = ".intval($_REQUEST['status']).", featured = 0, product_title = '".trim(saveToDB($data[0]))."', short_description = '".trim(saveToDB($data[1]))."', full_description = '".trim(saveToDB($data[2]))."'"; $sql_result = mysql_query($sql, $connection) or die ('Could not execute SQL query:<br />'.$sql.'<br /><strong>'.mysql_error().'</strong>');
  10. ok thx for the help
  11. ok good.would you know of a tutorial for this?just to give me an idea?
  12. i like the second one.. so there would be a submit on each tab?but how would the second submit relate to the first submit? so first tab is and insert and second is an update..
  13. Hey guy i was wondering how to make a form with tabs tha correspond to the same. Like lets say tab one description and name... Tab 2 is the image associated to that first tab... How can i make that? its for an auto classifield script.. Cause there is lots of details so i wanted to spread them in tabs..
  14. ok..wow.lol whats the = 3 if i do a settings in the admin panel that he selects what fiscal hear to show? like 2012-2013 then in the search i could but the function? like where date = $fiscal_year..
  15. Hey guys im dealing with a fiscal year issue.. so the script i did is for my body's school..so they have fiscal years..2011-2012 between march and April.. so the databse is set already with a date field. date_field 2012-01-10 15:53:41 is there a way to make it easy and only show fiscal year?cause this year is ok but next year i don't need to show the previous years..
  16. ya i reversed the calculation.thx for the help!
  17. ok so i did it like this one $percentage = round(($students_detention_num / $total_students) * 100); but the number gives me this? Percentage 400% 270 total detentions 1080 total students 400 2701080
  18. i get a Call to undefined function returnPercent() in /home/ecole514/public_html/V2/Main/Pourcentage.php on line 31 $x = 'SELECT COUNT(*) FROM Etudiant '; $result = mysql_query($x) or die(mysql_error()); $total_rows = mysql_fetch_row($result); $students_detention_num= $total_rows[0]; $x8 = 'SELECT COUNT(*) FROM Formulaire_S'; $result8 = mysql_query($x8) or die(mysql_error()); $total_rows8 = mysql_fetch_row($result8); $total_students= $total_rows8[0]; $percentage = returnPercent($students_detention_num,$total_students)
  19. ok thats not a problem. so returnPercent will automaticly calculate the %. thats cool..thx
  20. so i have a table with a number of students.(names-profileid...) and i have a detention table(name-date-time..) so i want to do a stats page that will calculate the percentage between the number of students and the detentions.. example 20% of the students go to detention.. then i can use it for months -weeks -per teacher....
  21. So the $num1 = the first filed in table? $num = field 2
  22. hey guys is it possible to have an output that will echo a percentage between 2 tables? like students vs detentions would give like 45%..
  23. || is not like and, example, in your case if you had: <? echo ($info['Status'] == 'Sold' && $info['Status'] == 'on hold') ? "<span class='echo'>".$info['Status']."</span>" :"For sale"; ?> Using the && and operator, this would mean that Both conditions would have to be met in order for you to receive the TRUEnternary response. However in your case, since you are using the || or operator, only one of the conditions needs to be met in order for the TRUE ternary response to output. this is the one i need.since they want in red on hold or if the car is sold.but i understand the && and toke note of it.thx for the help guys!
×
×
  • 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.