Jump to content

Interista

Members
  • Posts

    18
  • Joined

  • Last visited

Interista's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have tried ur way , it works but the only problem with time like that . if the restaurant open from 10:00:00 AM to the next day 03:00:00 AM ..
  2. global $currentTime; $currentTime = gmdate('G:i:s', time() + (3 * 3600)); $restTime = mysql_query("SELECT `r_ofrom` , `r_oto` , `rid` , `r_status` FROM `restaurant` "); while ($get_times = mysql_fetch_array($restTime)) { $openFrom = $get_times['r_ofrom']; $openTo = $get_times['r_oto']; $restID = $get_times['rid']; $restStatus = $get_times['r_status']; if ($currentTime > $openFrom && $currentTime < $openTo) { if ($restStatus == 'C') mysql_query("update restaurant SET r_status='O' where rid='$restID'"); } else { if ($restStatus == 'O') mysql_query("update restaurant SET r_status='C' where rid='$restID'"); } } No not as VARCHAR , I 'm storing the time as TIME . ex 20:00:00
  3. Hello, I have a restaurants opening times hours stored in MySQL DB for each restaurant as Time . ex 10:00:00 - 22:00:00 the problem is when I compare 7:30 with 22:30 , 7:30 would be more than 22:30 ! So I want to get current time and compare it with the stored one .
  4. Hello, I'm working on Address book , Every address have a edit button . When press on the edit button for each row , I want to get the address's values and show it into a form , the problem is that the form showing in a Lightbox . How I can send the address ID and return the values of this address and put it into a Lightbox form ?
  5. I'm using jQuery tooltip , so easy to use : http://onehackoranother.com/projects/jquery/tipsy/
  6. Sorry for not being clear , But the problems that I face is hard to do it in the query for me . because I want to sort result after filter it according to category type . so as example if I have a 5 rows , and filter it using category type it will be like 3 rows as example . How I can sort only the 3 rows not the whole result of the first query . I hope it's a clear now :$
  7. So that mean there is no way to do it using like functions in jQuery or anything else .. ! so I should make a functions with queries for all sort facilities available .
  8. OK I know that , But How I can sort the result of this query like sort it according the category . the only way use queries ?
  9. Hello, How I can sort MySQL result . I have to two selects box , Sort by alphabetical and sort by the categories , the two selects box in the same page . How I can filter the result according of the sort type . Like sort the result by specific category and in the same time sort it from Z to A . / DESC
  10. I think I fixed it like this way : if (isset($_GET['add'])){ if (!isset($_SESSION['cart_'.$_GET['add']])){ $_SESSION['cart_'.$_GET['add']]='1'; }else{ $_SESSION['cart_'.$_GET['add']]+='1'; } }
  11. Hello , I got error that said , I got this error only in the first set session , after that the error disappear . So as example i send ( cart.php?add=302 ) in URL , And this is what I got : Undefined index: cart_302 in C:\wamp\www\cart.php on line [i]9[/i] I'm using session for store my cart info , this is my session create code : if (isset($_GET['add'])){ $_SESSION['cart_'.$_GET['add']]+='1'; }
  12. U rock works great thank u so much for the help
  13. Oh OK , great info that will help me for sure . Thanks for help
  14. Hello , I'm a newbie in PHP but I have tried so much but nth work ! I want to print out products into categories like this way : Category 1 : product 1 product 2 product 3 Category 2: product 5 product 7 and so on .. This is my code which I'm using : $get_products = mysql_query("select * from ((product join category on cid = p_cid) join restaurant on rid = c_rid) join restaurant_type on rtid = r_rtid where rid = '$rest_id' order by rid, c_sortval, p_sortval"); while ($get_productsrows = mysql_fetch_assoc($get_products)) { echo ' <div class="product-box" id="products-box"> <table width="100%;">'; echo '<tr id="'.$get_productsrows['pid'].'" rel="desc" title="' . $get_productsrows['p_desc'] . '" > <td style="font-weight: bold;font-size:13px;" ><span class="name">' . $get_productsrows['p_name'] . '</span></td> <td style="text-align:center;font-size:11px;" >JD <span class="price">' . $get_productsrows['p_price'] . '+</span></td> <td style="text-align:center;"><input type="submit" value="Add" class="btn-add"></td> </tr> </table></div>'; This is only print out the all products for all categories for the restaurant ID .
×
×
  • 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.