![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
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"; ?>
-
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";
-
[SOLVED] Where with a large series of zip codes
pocobueno1388 replied to cooldude832's topic in MySQL Help
You need to use the "IN" syntax. So try this SELECT myfield FROM `postings` WHERE zip IN('12345', '45678', '66666') AND USER = $userid -
[SOLVED] How Do I Build Photo Album like this one?
pocobueno1388 replied to waynem801's topic in PHP Coding Help
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. -
[SOLVED] How Do I Build Photo Album like this one?
pocobueno1388 replied to waynem801's topic in PHP Coding Help
You would store all the photos in a database, then browsing through them is just pagination. -
This format is wrong: info.php?user=anna?page=2 It should be like this info.php?user=anna&page=2
-
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 ?>
-
What? You want to get the information from the row that has an "id" of 61? I don't quite understand what you want.
-
[SOLVED] including marquee tag on a database output
pocobueno1388 replied to webtuto's topic in PHP Coding Help
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>"; ?> -
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.
-
In that case, it's understandable. I've never messed with HTML validation, so I'm not too knowledgeable with that.
-
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.
-
& 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
-
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.
-
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
-
[SOLVED] how to show the "member area" only to members
pocobueno1388 replied to nyzach's topic in PHP Coding Help
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. -
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()); ?>
-
[SOLVED] Alternate row colors in table (new issue)
pocobueno1388 replied to Grant Holmes's topic in PHP Coding Help
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. -
[SOLVED] Alternate row colors in table (new issue)
pocobueno1388 replied to Grant Holmes's topic in PHP Coding Help
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'>"; } ?> -
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"); ?>
-
Try <tr><td>Notes:</td><td><textarea rows=\"10\" cols=\"50\" name=\"notes\">$notes</textarea></td></tr><br>
-
Another really hard and stupid question.
pocobueno1388 replied to HazelRah's topic in PHP Coding Help
Could you at least attempt to do what you want? Then along the way we can help you with whatever your having trouble with. -
Don't forget to press "topic solved".
-
You would write it just the same <a href="<?php echo $ps->organize_url(); ?>" target="_blank">Link</a>
-
[SOLVED] Override default php.ini to allow error checking!?
pocobueno1388 replied to Perad's topic in PHP Coding Help
At the top of the script, try putting this. error_reporting(E_ALL);