Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Can you post lines 400 to 404
  2. Hi Loversama Your need to replace this code if($row['instock']=='COU'){ echo '<td style="background:#F95151">£'.$row['price'].' (COU)</td>'; } elseif($row['instock']=='ASK'){ echo '<td style="background:#F9E351">£'.$row['price'].' (ASK)</td>'; } elseif($row['instock']=='NEW'){ echo '<td style="background:#F95151">N/A (NEW)</td>'; } else { echo '<td style="background:#'.$coco.'">£'.$row['price'].'</td>'; } with this if($row['Stock'] > 111){ echo '<td style="background:#F95151">£'.$row['price'].' (in Stock)</td>'; } elseif($row['Stock'] < 110){ echo '<td style="background:#F9E351">£'.$row['price'].' (ASK)</td>'; } elseif($row['instock']=='NEW'){ echo '<td style="background:#F95151">N/A (NEW)</td>'; } else { echo '<td style="background:#'.$coco.'">£'.$row['price'].'</td>'; } Note: 111 is the "certain figure" for (in Stock) 110 is the "certain figure" for (ASK)
  3. FROM movie AS people JOIN movie AS people Doesn't make any sense try SELECT movie.movie_name AS movie_title, people.people_fullname AS people_fullname FROM movie JOIN people ON movie.move_leadactor = people.people_id ORDER BY titles.movie_type
  4. Did you read the replies ?
  5. I assume msaz87 means "movie_leadactor" Jragon define "Nothing!" are you getting any output at all ? View source on the browser
  6. I assume msaz87 means "movie_leadactor" Jragon define "Nothing!" are you getting any output at all ?
  7. If your using <img src="<?php echo $post_thumb; ?>" alt="" ?> then I guess not, Of course to could pre parse the output but I wouldn't recommend such a work-around, another option would be to create a "missing-image.jpg" and then set $post_thumb to that for example if(empty($post_thumb){ $post_thumb = "missing-image.jpg"; }
  8. To could, or you could just do it correctly in the first place!
  9. It must be called before ANY output (including echo" WOOT!"; or echo "hello"; ) Any echo's will cause the header to failed!
  10. You question is quite ambiguous, so my answer is $user = ""; $pass = ""; if(Auth::validate_login($user,$pass)){ header("Location: Failed.html"); }
  11. You may want to review your "wordsExist" function! However if the google one also fails then you have either failed to supply some details are missed something from the examples given.. either way more details are needed!
  12. it should be header( "Location: $redir" ) ; NOT header( 'Location: $redir' ) ; note the single quotes won't parse the variable also the whole script should look like this <?php function wordsExist(&$string, $words) { foreach($words as &$word) { if(stripos($string, $word) !== false) { return true; } } return false; } if (wordsExist($search, array('word1','word2','word3'))) { $redir = $search; //this should be a URL! }else{ $redir = "http://www.google.com/search?q=$search"; } //Header MUST be sent before ANY output! header("Location: $redir") ; exit; //Anything below this pointless ?>
  13. I didn't expect this thread to still be going! You should be able to just use the example code on page 1 just add the extra fields in the select ie SELECT Responses.name,Answer1,Answer2,Answer3,Answer4,Answer5,Answer6,Answer7,Answer8,Answer9,Answer10,Answer11,Answer12, TIMESTAMPDIFF(SECOND,submit_timestamp,login_timestamp) as cTime FROM Responses LEFT JOIN Candidates USING (user_id)
  14. change echo $formatted_completion_time; to echo ($row['cTime']/60)." minutes AKA ".$formatted_completion_time; and see what you get EDIT: if the minutes are wrong then the query is wrong
  15. That means you have the function their twice! can you post what you have
  16. Hi webguync, Let get this solved Here are 2 methods, Minutes only <?php $sql_timestamp = "SELECT TIMESTAMPDIFF(MINUTE,submit_timestamp,login_timestamp) as cTime FROM Responses LEFT JOIN Candidates USING (user_id)"; $result_timestamp = mysql_query($sql_timestamp); if (!$result_timestamp) { echo "Could not successfully run query ($sql_timestamp) from DB: " . mysql_error(); exit; } while($row = mysql_fetch_assoc($result_timestamp)){ echo "<tr><th class='complete'>Completion Time:</th></tr><tr><td>\n"; echo $row['cTime']." Minutes"; echo "</td></tr>"; } ?> Expanded <?php $sql_timestamp = "SELECT TIMESTAMPDIFF(SECOND,submit_timestamp,login_timestamp) as cTime FROM Responses LEFT JOIN Candidates USING (user_id)"; $result_timestamp = mysql_query($sql_timestamp); if (!$result_timestamp) { echo "Could not successfully run query ($sql_timestamp) from DB: " . mysql_error(); exit; } while($row = mysql_fetch_assoc($result_timestamp)){ $formatted_completion_time = formatTime($row['cTime']); echo "<tr><th class='complete'>Completion Time:</th></tr><tr><td>\n"; echo $formatted_completion_time; echo "</td></tr>"; } function formatTime($cTime){ if($cTime < 60){ //less than 1 minute show seconds $formatted_completion_time = date("s",$cTime)." seconds"; }elseif($cTime < 3600){ //1 hour $formatted_completion_time = date("i",$cTime)." minutes"; }elseif($cTime < 86400){ //24 hours $formatted_completion_time = date("H:i",$cTime)." hours"; }else{ $formatted_completion_time = round($cTime/86400,0)." days"; } return $formatted_completion_time; } ?> Hope they help
  17. See ADDED $sql_timestamp = "SELECT unix_timestamp(TIMEDIFF(submit_timestamp, login_timestamp)) as cTime FROM Responses LEFT JOIN Candidates USING (user_id)"; $result_timestamp = mysql_query($sql_timestamp); if (!$result_timestamp) { echo "Could not successfully run query ($sql_timestamp) from DB: " . mysql_error(); exit; } $row = mysql_fetch_assoc($result_timestamp); //<----ADDED //some conditions if needed ie if($row['cTime'] < 60){ //less than 1 minute show seconds $formatted_completion_time = date("s",$row['cTime'])." seconds"; }elseif($row['cTime'] < (3600)){ $formatted_completion_time = date("i",floor($row['cTime']))." minutes"; }else{ $formatted_completion_time = date("H",floor($row['cTime']))." hours"; //technically wrong as it won't show more than 23 hours but you get the idea } echo "<tr><th class='complete'>Completion Time:</th></tr><tr><td>"; echo $formatted_completion_time; echo " minutes"; echo "</td></tr>";
  18. Personally I would do something like this $SQL = "SELECT unix_timestamp(TIMEDIFF(submit_timestamp, login_timestamp)) as cTime"; // //get mysql stuff //some conditions if needed ie if($row['cTime'] < 60){ //less than 1 minute show seconds $formatted_completion_time = date("s",$row['cTime'])." seconds"; }elseif($row['cTime'] < (3600)){ $formatted_completion_time = date("i",floor($row['cTime']))." minutes"; }else{ $formatted_completion_time = date("H",floor($row['cTime']))." hours"; //technically wrong as it won't show more than 23 hours but you get the idea }
  19. try this SELECT TIMEDIFF( '2010-05-26 10:16:21', '2010-05-26 10:13:53' ) result: 00:02:28
  20. you did what ? You hacked in and changed the point size.. What evil is this "firebug" it must of been raised from the under world again I'm joking My special encryption will sav me (hint "13") BZT lbhe n unpxre ~fpernzf yvxr n yvggyr tvey, naq ehaf sbe gur uvyyf~
  21. To create a "ajax style" upload, your need to put the file input into an iframe or something then use JS to do a submit post, or something like that, its all down to security. Options options would be to use another client side language, ie java, flash etc or just have the upload on another page hope that helps
  22. You can't send file data via JS, So no it won't work
  23. My details are on the same page but due to security concerns, I put then in a table (with black background) written in black text.. oh yes sir security is my top thing its so secure I may add my CC number and security code, LOL Yes I am joking!
  24. Great Remember to test each part of the system to check its all working as it should, It should as the line 50 was actually a bug fix, so nothing else should be effected any problems just ask --MadTechie
×
×
  • 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.