Jump to content

abrahamgarcia27

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by abrahamgarcia27

  1. I can't seem to figure out how to structure the following query. I have two type of content 1= helmet 2 = shoulder pads and i have grouped it by school_barcode it gives me all the rows in one result which is what i want. But now i want it to SUM all the count where the type is 1 and type is 2 and give me two different results. I have this table detail_id school_barcode bag_number type_content count receiving_id freight_bill time_stamp and have the following query $sql = "SELECT SUM(count), `".TABLE_RECEIVING_DETAIL."`.school_barcode, `".TABLE_SCHOOL."`.name FROM `".TABLE_RECEIVING_DETAIL."` LEFT JOIN `".TABLE_SCHOOL."` on `".TABLE_RECEIVING_DETAIL."`.school_barcode = `".TABLE_SCHOOL."`.bar_code WHERE receiving_id = '$receiving_id' AND freight_bill = '$freight_bill' GROUP BY school_barcode"; The end result should be Customer # | Cutomer Name | Helmets Received SUM | Shoulder Pads Received SUM
  2. Try something like this echo '<option value="'.$row['Type'].'" '.(($row['Type']==$record[data_value])?'selected="selected"':"").'>'.$row['Type'].'</option>';
  3. I would do something simple like date modified row on the actual thread table and when there is a post/comment just update that field and just order by date modified.
  4. I used str_replace and then used explode to get just the first number, Is this the best way to perform this task?
  5. well i was just brainstorming what would be the best way to do it. I just got the idea of using implode and explode functions to query just the number, but i do not know if that would be the best way.
  6. How would i write the php and htaccess for nice looking urls like this? http://forums.phpfreaks.com/forum/13-php-coding-help/ I have this php code function getservices(){ $db = new Database(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE); $db->connect(); //QUERY ACTIVE COLLECTIONS $sql = "SELECT service_id, name FROM `".TABLE_SERVICE."` ORDER BY sort_order ASC"; $rows = $db->fetch_all_array($sql); foreach($rows as $record){ echo '<li><a href="/services/'.$record['service_id'].'">'.$record['name'].'</a></li>'; } } And the htaccess is as follows RewriteRule ^services/([0-9]+)/?$ index.php?action=services&service_id=$1 [NC,L] #HANDLE SERVICES
  7. how would i tell the jquery function to listen to the id and get the contact id link? I know i would give the id via database primary id, but what is the proper way to just write one jquery function?
  8. I am having trouble getting the slideToggle function to work. i need to click on a href with a class and i want it to open a div underneath. i tried using the next() function, but that didnt work. So what the function does now is when i click the link it will slidetoggle all the contact div. I want it to open just the next div with the class of contact. PHP Function <div class="posting"> <div class="one columns"> '.$image.' </div> <div class="fifteen columns"> <a href="#" class="contactlink"><div class="posttitle">'.stripslashes($mainRow['book_title']).'</div></a> <div class="postdesc">'.stripslashes($mainRow['book_desc']).'</div> <br> <div class="three columns"><div class="postprice">$ '.stripslashes($mainRow['book_price']).'</div></div> <div class="three columns"><div class="postclass">'.stripslashes($mainRow['book_class']).'</div></div> <div class="three columns"><div class="postcondition">'.stripslashes($mainRow['book_condition']).'</div></div> </div> </div> <div class="clear"></div> <hr> <div class="contact" style="display:none;"> <form action=""> <input type="text"> <input type="text"> <input type="text"> </form> </div> jQuery Function $(document).ready(function() { $('.contactlink').click(function() { $(".contact").slideToggle('fast'); // Toggle dd when the respective dt is clicked }); });
  9. I got a Mortgage Broker Site project, the client requested to use FHA VA & Conventional daily mortgage rates. I cannot seem to find an API that allows to display these rates on my site. I found this API, but it does not show the different mortgage programs. Could someone that is experienced on the these kind of sites point me toward the right direction. http://www.mlcalc.com/free-widgets/mortgage-rates/
  10. Ok i think the best way to explain the problem is by giving you the example of how the page should work How it should work: http://sunerandgarcia.com/clients/tucanes/fotoscon/56 (Does not contain AJAX Request) How it is currently: http://sunerandgarcia.com/clients/tucanes/fotos (Does contain AJAX Request) So the problem is when you hover the Elements that should load via jQuery do not load for some reason.
  11. So i am working on a page i am using a tutorial found online to paginate a gallery via infinite scroll. I have the plugin working, but the elements of the theme such a magnifying glass on hover do not work. I am sure the problem has to do with the content being loaded via AJAX. When i inspect the element the all the div are there, but when i view source it does not show the data that is being appended, so i believe that is where the problem is at. The problem is i don't know how to fix this issue, if someone could guide me toward the right way that would be great. Link: http://sunerandgarcia.com/clients/tucanes/fotos
  12. Try this ORDER BY CAST(`RMA` AS SIGNED) DESC
  13. Interger Type : "is a number that can be written without a fractional or decimal component"
  14. I am trying to rewrite this link to http://sunerandgarcia.com/clients/oster2/index.php?action=portfolio-single&portfolio_id=IL_ipJBKRg4zlbefl3AU9zZvj6OjmQGErnI1iVDRWbU to http://sunerandgarcia.com/clients/oster2/port/IL_ipJBKRg4zlbefl3AU9zZvj6OjmQGErnI1iVDRWbU I wrote the following rule RewriteRule ^port/(.*)/?$ ./index.php?action=portfolio-single&portfolio_id=$1 [NC,L] But when i go to the link it does not load the images or stylesheets. All the images come with the directory port so that is why it is not loading. i tried putting the ./ before index, but it did not fix anything.
  15. Thanks i just changed the date field to DATE.
  16. I am trying to sort by date my date posted format is the following 4/9/2013 -> Month / Day / Year I am using the following query (I want to put the newest at top) $mainQuery = "SELECT SQL_CALC_FOUND_ROWS * FROM `".TABLE_BLOG."` ORDER BY DATE(posted_date) DESC LIMIT ".(int)($perPage*($p-1)).','.(int)$perPage." "; But it is not ordering correctly the information Could anyone help me figure this out?
  17. I made something not finish, but maybe it can help you. You just need to get the value of the me=1 maybe you can assign an attribute and look for that. <html> <head> <title>Ajax Help</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("a").click(function(event) { event.preventDefault(); $.get("action.php", { me: "1" }, function(data) { $('#log').html(data); }); }); }); </script> </head> <body> <a href="./action.php?me=1" class="member">member1</a> <div id="log"></div> </body> </html>
  18. Check this sample <p> <label>State</label> <span class="formwrapper"> <select data-placeholder="Choose a State..." name="state" class="chzn-select" tabindex="2"> <?php $state_list = array('AL'=>"Alabama", 'AK'=>"Alaska", 'AZ'=>"Arizona", 'AR'=>"Arkansas", 'CA'=>"California", 'CO'=>"Colorado", 'CT'=>"Connecticut", 'DE'=>"Delaware", 'DC'=>"District Of Columbia", 'FL'=>"Florida", 'GA'=>"Georgia", 'HI'=>"Hawaii", 'ID'=>"Idaho", 'IL'=>"Illinois", 'IN'=>"Indiana", 'IA'=>"Iowa", 'KS'=>"Kansas", 'KY'=>"Kentucky", 'LA'=>"Louisiana", 'ME'=>"Maine", 'MD'=>"Maryland", 'MA'=>"Massachusetts", 'MI'=>"Michigan", 'MN'=>"Minnesota", 'MS'=>"Mississippi", 'MO'=>"Missouri", 'MT'=>"Montana", 'NE'=>"Nebraska", 'NV'=>"Nevada", 'NH'=>"New Hampshire", 'NJ'=>"New Jersey", 'NM'=>"New Mexico", 'NY'=>"New York", 'NC'=>"North Carolina", 'ND'=>"North Dakota", 'OH'=>"Ohio", 'OK'=>"Oklahoma", 'OR'=>"Oregon", 'PA'=>"Pennsylvania", 'RI'=>"Rhode Island", 'SC'=>"South Carolina", 'SD'=>"South Dakota", 'TN'=>"Tennessee", 'TX'=>"Texas", 'UT'=>"Utah", 'VT'=>"Vermont", 'VA'=>"Virginia", 'WA'=>"Washington", 'WV'=>"West Virginia", 'WI'=>"Wisconsin", 'WY'=>"Wyoming"); foreach ($state_list as $key => $value) { ?> <option value="<?php echo $key; ?>" <?php if($record['state'] == $key)echo "selected";?>><? echo $value; ?></option> <?php } ?> </select> </span> </p>
  19. Use something like this $ida = $_POST['id']; foreach($ida as $id){ $catname = $_POST['catname']; $id1 = $id; mysql_query("UPDATE ticket_cats SET name='$catname' WHERE id='$id1'"); }
  20. Thats not what i get check it out http://sunerandgarcia.com/phpfreaks/checkbox.html
  21. It should work did you put the for loop inside the body of the email, so it sends every checked value in the email? Do not look the whole body though
  22. Use this instead <form action="exec.php" method="post"> <input name="checkbox[]" type="checkbox" id="checkbox" value="I AM INTERESTED IN BEING A DISTRIBUTOR"> <input name="checkbox[]" type="checkbox" id="checkbox" value="I OWN A FLEET OF COMMERCIAL VEHICLES"> <input name="checkbox[]" type="checkbox" id="checkbox" value="I NEED A LOCAL SUPPLIER FOR MYGREENOIL"> <input name="checkbox[]" type="checkbox" id="checkbox" value="I HAVE A TECHNICAL QUESTION"> <input type="submit" value="submit" />
  23. I believe you are missing the name on the input field for checkbox <input name="checkbox" type="checkbox" id="checkbox" name ="checkbox" value="I AM INTERESTED IN BEING A DISTRIBUTOR">
  24. Actually i downloaded mozilla and it worked fine. But i tried deleting the cookies in chrome and still no luck. So you were right it has to do with the cookies.
×
×
  • 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.