-
Posts
812 -
Joined
-
Last visited
Posts posted by techker
-
-
wow fast..
will this formula do what i need?cause now im getting zero output from it..
-
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";
-
ahh...lol thx
-
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
-
ok thx i will google the phpmyadmin import csv to see..
-
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?
-
So
QTY = '".trim(saveToDB($data[3]))."',
Prices = '".trim(saveToDB($data[4]))."',
Image = '".trim(saveToDB($data[5]))."',
-
how would i read it from the csv?
is it this?
short_description = '".trim(saveToDB($data[1]))."',
full_description = '".trim(saveToDB($data[2]))."'";
-
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...
-
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>');
-
ok thx for the help
-
ok good.would you know of a tutorial for this?just to give me an idea?
-
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..
-
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..
-
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..
-
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..
-
ya i reversed the calculation.thx for the help!
-
true, i use functions where I can for re-usability in my code, as i believe it should be.
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
-
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)
-
ok thats not a problem.
so returnPercent will automaticly calculate the %.
thats cool..thx
-
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....
-
With a little math, sure.
function returnPercent($num1,$total) { return round($num / $total * 100) . "%"; }
Thx.
So the $num1 = the first filed in table? $num = field 2
-
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%..
-
so basicly || is like an AND.
thanks for the help!
|| 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!
left join
in MySQL Help
Posted
ok cool thx!