Jump to content

joesoaper

Members
  • Posts

    30
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

joesoaper's Achievements

Member

Member (2/5)

0

Reputation

  1. Thank you so much mac_gyver, really appreciate the time you put into this to help me.
  2. Thank you very much for that... very informative.
  3. Sorry to be dumb.. but if I do that then how can i select dates.. the to and from?
  4. I have a drop down box in my search form: search.php <form action="report.php" method="get"> Service Docket report from : <input type="date" name="d1" value="" /> to: <input type="date" name="d2" value="" /> <select size="1" name="status" > <option value=" ">All</option> <option value="Open">Open</option> <option value="Closed">Closed</option> </select> This goes to the php query: report.php <?php include('connect.php'); if (isset($_GET["d1"])) { $d1 = $_GET["d1"]; } else { $d1=0; }; if (isset($_GET["d2"])) { $d2 = $_GET["d2"]; } else { $d2=0; }; if (isset($_GET["status"])) { $status = $_GET["status"]; } else { $status=0; }; $result = $db->prepare("SELECT * FROM invoices WHERE date BETWEEN :a AND :b AND status LIKE :c ORDER BY s_doc ASC"); $result->bindParam(':a', $d1); $result->bindParam(':b', $d2); $result->bindParam(':c', $status); $result->execute(); $count = $result->rowCount(); print("<b> $count\n"); for($i=0; $row = $result->fetch(); $i++) { ?> I have been trying to get the query to select all records when the status drop down box is set to "All", but with no success. I have tried setting the value to * and "" and " " as well as many other variations of that but all to no avail. Thank you in advance for any advice.
  5. Thank you all very much, it is very much appreciated!
  6. I have tried everything I know.. which admittedly is not that much.. when I ask for help it is only because I have absolutely no idea how to get it right. I generally prefer resolving problems myself.
  7. This is most probably very simple but after 3 hours I admit I need help <tr> <td ><input name="qty1" size="1" type="text" value="<?php echo !empty($qty1)?$qty1:'';?>" > </td> <td ><input name="desc1" size="70" type="text" value="<?php echo !empty($desc1)?$desc1:'';?>" > </td> <td ><input name="unit1" size="5" type="text" value="<?php echo !empty($unit1)?$unit1:'';?>" ></td> <td ><input name="disc1" size="1" type="text" value="<?php echo !empty($disc1)?$disc1:'';?>" ></td> <td ><input name="total1" size="6" type="text" READONLY value="<?php echo !empty($total1)?$total1:'';?>" ></td> </tr> In this row I want to only echo the total1 only IF it is greater than Zero. It currently shows 0.00 which i would rather not have there. For some reason I just cannot get it right. I am new to PHP PDO so maybe that might be the problem. If you need more of the code please let me know and I will post it
  8. I have no idea what that means, if you cannot give any help just say so, if my code it totally wrong say so as well, then at least I will have an idea of where I am wrong and I can try and fix it..
  9. I need to do a query that will show me all models and totals even if it is zero. The query only gives the models with 1 or more in stock. Sample here below. Model 1 5 Model 2 15 Model 17 10 This is the code I am using $sql = 'SELECT status, model, COUNT(model) FROM club_inventory WHERE status="In-Stock" AND prod="Jets" GROUP BY model '; foreach ($pdo->query($sql) as $row) { echo '<tr>'; echo '<td>'. $row['model'] . '</td>'; echo '<td>'. $row['COUNT(model)'] . '</td>'; echo '</td>'; echo '</tr>'; } Any help would be greatly appreciated.
  10. If you read my responses you will see that I am fully open to advice, it is just the manner in which it is delivered. I found a solution as I said and it was through taquito. Upon reading ginerjms's reply I immediately began studying the pdo method and changing the way I code. I might think hes a sarcastic twit but that does mean I just discounted what he said. I know that I know next to nothing about php coding and can learn from anyone even if I disagree with the method of delivery. I do read and learn from ALL advice.
  11. Yes well you will see more of my posts. Where I come form terms like " If you bother to read the manual, or ever look at it " is just being rude and really being sarcastic .. however I have no idea where you all come from. All I did was ask a simple question seeking help... if it is too much to accept a civil reply then maybe this is the wrong forum for newbies. Read the first guys reply.. was amazingly polite and helpful even though he did not just say here is the answer he pointed me in the right direction and I resolved the issue. Maybe The Internet is not for older people like me who grew up showing respect to people no matter where they come from or how they asked what might seem very dumb questions. You all however seem to support his obvious rudeness maybe because he is an "Advanced Member".. which means nothing to me. Thank you again taquitosensei for a very simple polite answer that helped me solve the issue.
  12. Nice try your attitude still sucks though, do not care how clever you think you are.. sarcasm is a poor teacher as you so ably show, and criticism being given when someone ask for help is just lame
  13. Thanks for the advice taquitosensei at least you have pointed me in the right direction. . As for ever ginerjm and your "bothering" to read the manual, sounds like your attitude needs a big readjustment. I thought people who came here for help were given advice on how to resolve coding problems, however you talk to people like they are idiots and your condescending attitude sucks big time. I am sure when you started coding you knew it all and never had to ask anyone for help because of your "superior attitude" rather than your "superior intellect". Humility is a virtue that you sadly seem to lack. Most probably I will get banned or something equally petty but also maybe someone needs to tell you how it really is, so it will be worth it.
  14. The following code is the one I am using. I want to echo the COUNT(model) function in my report, all my attempts have failed $result = mysql_query("SELECT model, COUNT(model) AS stockfig FROM inventory WHERE status='In-Stock' GROUP BY model ORDER BY model ASC "); $num = mysql_num_rows ($result); if ($num > 0 ) { $i=0; while ($i < $num) { $id = stripslashes(mysql_result($result,$i,"id")); $model = stripslashes(mysql_result($result,$i,"model")); $status = stripslashes(mysql_result($result,$i,"status")); $row .= ' <td>'.$model.'</td> <td>'.$status.'</td> <td>'.$count.'</td> <td><a href="update.php?id='.$id.'">View</a></td> </tr>'; Any help would be greatly appreciated.
×
×
  • 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.