Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. It's kinda hard to figure out what you want...but I'm guessing something like this <?php $var = mysql_real_escape_string($_GET['var']); $query = "SELECT * FROM table WHERE col='$var'"; $result = mysql_query($query)or die(mysql_error()); while ($row = mysql_fetch_assoc($result)){ echo $row['col'].'<br>'; } ?>
  2. Ah, I meant for you to only change that specific part of the code that I posted, not erase everything else. Okay, so do this so I can see <?php require('includes/get_connected.php'); $query = "SELECT * FROM comics WHERE comic_id= '45'"; $result = mysql_query($query); $num = mysql_num_rows($result); $i = 0; while ($i<$num) { $age = mysql_result($result, $i, 'age'); $TheList = array("Select Twe" => 0, "Golden" => "Golden", "Silver" => "Silver", "Bronze" => "Bronze", "Modern" => "Modern"); echo "<select name='ud_age'>"; foreach($TheList as $K => $V) { if ($V == $age) { $sel = "selected"; } else { $sel = ""; } echo "<option value='$V' $sel>$K - $V - $age</option>"; } echo "</select>"; ++$i; } ?>
  3. BAM! There is your problem. Notice how your $age variable is empty? So your probably not getting the results from the database properly. Can you post more of you code? Post the query and everything...I need to see what your doing with that variable.
  4. Okay, try this code and post us the link to where we can view it as well. <?php $TheList = array( "Select Twe" => 0, "Golden" => "Golden", "Silver" => "Silver", "Bronze" => "Bronze", "Modern" => "Modern"); echo "<select name='ud_age'>"; foreach($TheList as $K => $V) { if ($V == $age) { $sel = "selected"; } else { $sel = ""; } echo "<option value='$V' $sel>$K - $V - $age</option>"; } echo "</select>"; ++$i; } ?>
  5. Exactly why are you trying to avoid using the date function?
  6. I don't see why not. Although, I'm sure you could figure out a way to get rid of the for loop altogether and do everything you need to in the while loop. I guess you would have to explain a situation...but yes, you can, it just may not be the best approach.
  7. You should be able to do that by just setting the tables width to whatever the banners width is. This is really just an HTML problem.
  8. The information is already stored in an array when it comes out of the database, why would you restore it in a different one?
  9. I don't understand what you want...explain a little more.
  10. Your page is kinda messed up cooldude...but it worked for me also. I have no idea whats going on for you suttercain.
  11. This works fine for me <?php $TheList = array( "Select Twe" => 0, "Golden" => "Golden", "Silver" => "Silver", "Bronze" => "Bronze", "Modern" => "Modern"); $age = 'Silver'; echo "<select name='ud_age'>"; foreach($TheList as $K => $V){ if ($V == $age) { $sel = "selected"; } else { $sel = ""; } echo "<option value='$V' $sel>$K - $V</option>"; } echo "</select>"; ?> Check your value from the database ($age).
  12. No, you can't do anything client side with PHP. I would suggest looking into AJAX or JavaScript.
  13. Try pg_fetch_array() http://us3.php.net/manual/en/function.pg-fetch-array.php
  14. This is such a common question that there is a tutorial made for it http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
  15. Google http://www.eoghanobrien.com/article/7/php-rating-system-tutorial http://www.phptoys.com/e107_plugins/content/content.php?content.75 http://www.zenphoto.org/support/topic.php?id=1095
  16. Okay, here is some code to give you a start. <?php //check if they submitted the form if (isset($_POST['submit'])){ if ($_POST['action'] == 'buy'){ echo "These are the items that were selected [they chose 'buy']<br>"; //Loop through the selected items foreach ($_POST['selected'] as $itemID){ echo $itemID.'<br>'; //this is where you would do your query } } else { echo "They chose 'sell'"; } } $result = mysql_query("SELECT * FROM phpbb_adr_shops_items WHERE item_owner_id = '1' ")or die(mysql_error()); $num_rows = mysql_num_rows($result); print "There are $num_rows records.<P>"; print "<form action='{$_SERVER['PHP_SELF']}' method='post'>"; print '<table width=200 border=1>'."\n"; while ($get_info = mysql_fetch_assoc($result)) { print "<tr>"; print "\t<td><font face=arial size=1/>"; print "<input type='checkbox' name='selected[]' value='{$get_info['item_id']}' />" .$get_info['item_name']. $get_info['item_id']."</font></td>"; print "</tr>"; } echo '<select name="action">' .'<option value="buy">Buy</option>' .'<option value="sell">Sell</option>' .'</select><p>'; echo '<input type="submit" name="submit">'; echo '</form>'; ?> Let me know if you have any problems with it.
  17. First off, how are you determining what the name of the link is? Are you pulling them from the database, an array, or what?
  18. Your confusing me. The problem you just posted is completely different than what you posted in the original post. From your fist post, it sounds like this is the chunk of code your having problems with <?php $result = mysql_query("SELECT * FROM phpbb_adr_shops_items WHERE item_owner_id = '1' ") or die(mysql_error()); $num_rows = mysql_num_rows($result); print "There are $num_rows records.<P>"; print '<table width=200 border=1>'."\n"; while ($get_info = mysql_fetch_assoc($result)){ print "<tr>"; print "\t<td><font face=arial size=1/>"; print '<input type="checkbox" name="namehere" />'.$get_info['item_name']. $get_info['item_id'].'</font></td>'; print "</tr>"; } ?> Tell us exactly what the problem is, and what you would like to happen.
  19. You don't need us doing all the work for you, I will give you the basics. To register a session $_SESSION['var'] = "var"; To check if a session exists if (isset($_SESSION['var'])){ //It's set } You need to call session_start(); at the beginning of every file. Thats basically call the information you need...now just go replace all the cookies to sessions.
  20. You could do something like this... <?php for($i=1; $i<=4; $i++){ if ($i == 1) echo 'Link'.$i.' | '; else echo "<a href='page.php?id=$i'>link$i</a> | "; } ?>
  21. Well...you need to figure out where that error is coming from to figure out whats wrong. I assume it's coming from your connection script...so something still must be wrong.
  22. Change include('connect.php); To include('connect.php');
  23. Looks like you have the wrong username or host. You might want to check in with your host to see if you are supposed to use "localhost".
×
×
  • 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.