Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Your query would look something like this <?php $search = mysql_real_escape_string($_POST['search']); $query = "SELECT * FROM files WHERE name LIKE '%$search%' LIMIT $limitvalue, $limit"; ?>
  2. Lets look at this part of the WHERE clause AND state = ' . $db->escape($state) . ' First off you don't have the variable in quotes. Second you are using aliasing throughout the rest of the query, so why are you not using it for the column "state"? So your query should be changed to $query = "SELECT listing.id AS id, listing.views AS views, listing.price AS price, listing.type AS type, town.name AS town, town.state AS state, listing.town_id AS town_id FROM listing, town WHERE listing.town_id = town.id AND town.state = '".$db->escape($state)."' ORDER BY views DESC LIMIT 9";
  3. You need to use the "IN" syntax. So try this SELECT myfield FROM `postings` WHERE zip IN('12345', '45678', '66666') AND USER = $userid
  4. Pagination Tutorial http://php.about.com/od/phpwithmysql/ss/php_pagination.htm I didn't completely look through this, but it looks like exactly what you need http://www.sitepoint.com/article/php-gallery-system-minutes This one may be good too http://www.codewalkers.com/c/a/Miscellaneous/Creating-an-Image-Gallery/ All I can say is search Google. That is where I'm getting all this information from. Photo galleries are a pretty common need, so I'm sure there are plenty of things out there you can use.
  5. You would store all the photos in a database, then browsing through them is just pagination.
  6. This format is wrong: info.php?user=anna?page=2 It should be like this info.php?user=anna&page=2
  7. I understand now <?php $query = mysql_query("SELECT SUM(down_count) as total FROM tableName")or die(mysql_error()); $row = mysql_fetch_assoc($query); echo $row['total']; //should echo 61 ?>
  8. What? You want to get the information from the row that has an "id" of 61? I don't quite understand what you want.
  9. Try <?php include("config.php"); $sql="select * from slayer.marquee order by id desc LIMIT 0,10"; $res=mysql_query($sql); echo "<marquee><table><tr>"; while($row=mysql_fetch_array($res)){ echo '<td>'.$row['name'].' </td>'; echo '<td>'.$row['msg'].'</td>'; } echo "</tr></table></marquee>"; ?>
  10. You probably just need to add a new div, it's hard to help without seeing any code though. You would add CSS to your php files by either putting it outside the PHP tags, or use the echo or print function.
  11. In that case, it's understandable. I've never messed with HTML validation, so I'm not too knowledgeable with that.
  12. I think the layout is pretty nice. Maybe add some rollover images for the links. The javascript works for me, but I'm not so sure it's necessary. If someone needed to change the font size, they could do so with their browser. Also, not sure why you would want to give them a text color choice, I'm sure everyone would be fine with the white or gray. I suppose it's pretty cool, but kinda useless if you ask me.
  13. & is entity name of & Oh duh! I should have known that, hah. Well, why not just take the shortcut and only write & instead of the entity? ;P
  14. I've never heard of putting &...you only have to put the & to separate the variables. <a href="www.example.com/welcome.php?id=Chinese&anotherarg=somethingelse">Text</a> You may be able to do it both ways...I'm not sure.
  15. You need to use the header function. <?php $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; mail($to, $subject, $body, $headers); ?> Beat to it
  16. You need to check to see if the user is logged in on every page that you only want logged in members to be able to see. So you need to register a session when the user logs in, then check if that session exists on the members page.
  17. Your not using mysql_query. Change your code to this: <?php $GetFight = mysql_query("DELETE FROM attack WHERE Attacker='{$_SESSION['Current_User']}'") or die(mysql_error()); ?>
  18. Not tehcnically double quotes, quotation and escaping is as very "lose" topic in php (or 'lose' for you single quoters) read up on it as you can do it many ways once you find a method comfortable stick to it I like to use double quotes across and singles for mysql values and array keys i.e <?php $day_the_week = "Tuesday"; echo "Welcome: ".$_SESSION['UserData']['Username']." to \"The\" place today is ".$day_the_week.", have a great day."; ?> That is how I like to do things but it isn't the only way to do it. Yes, there are a few ways you can do it. It really doesn't make a difference whether you use concatenation as you did, or if you just use double quotes so PHP doesn't process the line as just a string. It's just personal preference.
  19. You need to use double quotes with your echo. Try <?php //Alternate Row Color if($i % 2) { echo "<TR bgcolor='$DarkRowColor'>"; } else { echo "<TR bgcolor='$LightRowColor'>"; } ?>
  20. You need to put quotes around your variable, it would also help to print the query out. <?php $delExceptionSql = "DELETE FROM ct_print_setup WHERE id = '$exceptionID'"; mysql_query($delExceptionSql) or die(mysql_error()."<p>With Query:<br>$delExceptionSql"); ?>
  21. Try <tr><td>Notes:</td><td><textarea rows=\"10\" cols=\"50\" name=\"notes\">$notes</textarea></td></tr><br>
  22. Could you at least attempt to do what you want? Then along the way we can help you with whatever your having trouble with.
  23. Don't forget to press "topic solved".
  24. You would write it just the same <a href="<?php echo $ps->organize_url(); ?>" target="_blank">Link</a>
  25. At the top of the script, try putting this. error_reporting(E_ALL);
×
×
  • 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.