Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. You need to alias the field, that way you can use it as a variable. So try the following <?php $SCustId = $_REQUEST['SCustId']; $paymentquery = "SELECT SUM(Amount) as total FROM ".PAYMENTSRECEIVED." WHERE SCustID = '".$SCustId."'"; $paymentresult = mysql_query($paymentquery) or die(mysql_error()); $paymentrow = mysql_fetch_array($paymentresult); $paymenttotal = $paymentrow['total']; ?>
  2. Use a textarea instead, your not going to be able to do it with a text input. <textarea name="..." rows=5 cols=10></textarea>
  3. You don't have any INSERT queries at all in that code...so of course the value isn't being stored in the database. Can you point out the line that attempts to store it in the DB...although I don't think it exists?
  4. Can you post the code you use to process the information, all the way up to when you do your insert query?
  5. What don't you know how to do? You can't just post some code and expect everyone else to know what you need. You actually need to explain what your trying to do.
  6. There is way too much code there to go through. Could you at least go in and only show us the relevant code?
  7. Add a die error to the end of your query mysql_query("INSERT INTO `product` (`id` , `title` , `item` , `price` , `processor` , `image` , `memory` , `hdd` , `cdrom`, `display` , `other` , `os` , `warranty` , `type` , `make`) VALUES (NULL, '$title','$item','$price','$processor','$image','$memory','$hdd','$cdrom','$display','$other','$os','$warranty','$type','$make')")or die(mysql_error());
  8. Change $MM_redirectLoginSuccess = "clientPage.php?clientId=<?php echo $_GET['clientId']; ?>"; To $MM_redirectLoginSuccess = "clientPage.php?clientId=" . $_GET['clientId'];
  9. You need to put single quotes around all the variables in your insert query. mysql_query("INSERT INTO users (username, password, email, country, province) VALUES('$username', '$password', '$email', '$country', '$province') ") or die(mysql_error()); Also, you need to be using mysql_real_escape_string() on all your variables.
  10. In the example you give, this is how you would do it: <?php for($i =0; $i<10; $i++){ if($i == 9){ echo 'this is last in the loop.'; } } ?>
  11. Try <?php include("db.php"); $query = mysql_query("SELECT * FROM games")or die(mysql_error()); $i = 1; while ($row = mysql_fetch_assoc($query)){ if ($i == 1 || $i == 2){ echo $row['title'] .'<br>'; } else { //this is where you put the code for all the other posts } $i++; }
  12. change the query to $query = mysql_query("SELECT fields FROM table ORDER BY id DESC");
  13. Yes, as long as you use the code I supplied. Just make sure you change the query to select what you need.
  14. You could do this: <?php $query = mysql_query("SELECT fields FROM table"); $i = 1; while ($row = mysql_fetch_assoc($query)){ if ($i == 1 || $i == 2){ //this is where you put the code for the two featured posts } else { //this is where you put the code for all the other posts } $i++; } ?>
  15. Store it in this format: yyyy-mm-dd Then when you retrieve it from the database, you can easily manipulate how you want it displayed with either a MySQL function, or the PHP date() function.
  16. Store all the post data in a session...that way you have it for as long as you need.
  17. Your making it more complicated than it needs to be. Just do this SELECT id FROM table ORDER BY id DESC LIMIT 3 Just change the 3 to however many you want to select.
  18. Try $query = "SELECT pid, name, position FROM cn_people WHERE category='2' AND published='1' ORDER BY pid DESC";
  19. You need to grab/manipulate that number from the database each time. Going with sessions isn't going to work, and you already stated the problem, and there is no way around that.
  20. You have to configure your .htaccess file. You need to add this line to it: AddType application/x-httpd-php .php .html Beat to it.
  21. I didn't go very far, but it looks great. I think kids will love it.
  22. Does the file have a php or html extension? If it's HTML, then it's not going to work unless you set it up to. If it's a PHP file, you need to open the php tags, like this: <input type="text" name="name" value="<?php echo $row['pi_first_name']; ?>" />
  23. It means: If $width is greater than $height, set $ref to the value of $width...otherwise set $ref to the value of $height.
  24. SELECT * FROM table WHERE unit='A' OR unit='B'
×
×
  • 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.