HuggieBear
Members-
Posts
1,899 -
Joined
-
Last visited
Everything posted by HuggieBear
-
This is not a php question... It's DHTML. You're obviously using layers, as HTML doesn't allow objects on top of each other. I'd suggest posting this in the HTML forum on this board. Regards Huggie
-
Are you able to display the code for the search form and also the code that's processing the $_POST/GET request before passing the $PartSearch to the SQL statement. Regards Huggie
-
Yes, it's the same style that you need, I'll post the full code with columns tomorrow. Regards Huggie
-
OK, if you don't have the information in the database then you'll need something like an array with the data in. [code] <?php $profession = array(111 => "Plumber", 211 => "Electrician", 311 => "Joiner"); $sql = "SELECT job FROM tablename"; $result = mysql_query($sql); while ($roles = $mysql_fetch_array($result, MYSQL_ASSOC)){ extract($roles); echo "{$job} => {$profession[$job]}"; } ?> [/code] Regards Huggie
-
Oh I see, it can be done, but it's going to take some time to get right... I have a script that does something similar, I can post the code for you tomorrow when I get home. See here: http://www.dizzie.co.uk/php/pages2.php Regards Huggie
-
I'm assuming that you have the names of the job in your database e.g. [b]Jobs[/b] [table] [tr][td]ID[/td][td]Number[/td][td]Name[/td][/tr] [tr][td]1[/td][td]111[/td][td]Clean Windows[/td][/tr] [tr][td]2[/td][td]211[/td][td]Wash Clothes[/td][/tr] [tr][td]3[/td][td]311[/td][td]Empty Bins[/td][/tr] [/table] If so then yes, it's quite simple. Regards Huggie
-
And finally, is there going to be exactly 20 cities in each column (state). Regards Huggie
-
OK, can you provide me the structure of your database then... Huggie
-
OK, and are you just having a column for each state no matter how many rows there are? Huggie
-
Try this: [code] <?php session_start(); echo "Hello"; mysql_connect ("localhost", "root", "445589" ); mysql_select_db("counter01"); if ($_SESSION['counted'] != "true"){ $result = mysql_query("UPDATE simplecount SET count = (count + 1) WHERE count_id = 1") or die ("Unable to execute query: " . mysql_error()); $_SESSION['counted'] = $result; } ?> [/code] The result of an update statement in mysql_query() is always either true or false, so why not use that as above. Also put a bit of error handling in there. Regards Huggie
-
It's updating the [color=red]count[/color] field in the [color=green]simplecount[/color] table. Also, the following is wrong: [code] <?php mysql_query ("UPDATE simplecount SET count=(count + 1) WHERE count_id=1"); WHERE count_id=1"); ?> [/code] It should just be as follows: [code] <?php mysql_query ("UPDATE simplecount SET count=(count + 1) WHERE count_id=1"); ?> [/code] Regards Huggie
-
You need to get your information correct before we start. For example, 4 rows of 20 is 80, so you don't want to display your remaining 20 records? Also, can you not provide us with some actual data, rather than ABC BBB CCC etc, which incidently, it also looks like you got wrong. Regards Huggie
-
OK, Unless you provide all of the code you're using for this image, I can only help from what you've provided, which is likely to be incomplete. 1. Make sure you've already called [color=green]imagecreatetruecolor()[/color] 2. Make sure you've defined the constant DIR_IMAGE. 3. Try echoing both $destImg and $new_image to make sure they look as expected. Regards Huggie
-
I've had a look at your page and it appears to be fine. Are you still having problems. Regards Huggie
-
Something like this should work... [code=php:0]$query="SELECT * FROM `sc_friend` WHERE (x = 1 AND y = 2) OR (x = 2 AND y= 1)"; [/code] Regards Huggie
-
OK, so like I said, do you want a current timestamp in the timestamp field? MySQL's [b]now()[/b] function will do that, see my code above. Huggie
-
You need to convert the time in php to a format MySQL can recognise... $date = time(); as suggested will not give you a valid date format in MySQL. Do you just want a current timestamp, if so, use this: [code] <?php $query = "INSERT INTO onlineform (name, Cname, email, query, Pnumber, date) VALUES ('$Name','$Cname','$email','$Query', '$Pnumber', now())"; ?> [/code] Regards Huggie
-
Yeah, I think it was. Huggie
-
I'm not getting an error, I pasted this reply for someone else saying that this code works, but the original post disappeared, so I added this solution as a new topic. Regards Huggie
-
OK, pretty much the only information they can get from you is what your browser provides. They maybe looking at your IP address and seeing where it's registered or something slightly more advanced, but it's unlikely. Huggie
-
I'm not sure what just happened to this topic, but this code works. Regards Huggie [code] <?php function tables () { $tablepre = "prefix_"; $tables = array('settings', 'modules', 'news'); foreach ($tables as $tablename) { $key = "table_$tablename"; $tablenames[$key] = $tablepre.$tablename; } return $tablenames; } $mytables = tables(); var_dump($mytables); ?> [/code]
-
ok, in that case they're psychic websites... Can you provide an example site, I'll check it out. Regards Huggie
-
Yes, if they've already provided you with the details. You can ask the user for those details and let them submit them, you can then save them somewhere, like inside a database, then recall them when the user returns. Regards Huggie
-
OK, the reason you're getting the error is that this line is incorrect: [code=php:0]$result = mysql_query("SELECT * FROM site ORDER BY $column ASC LIMIT (20, 0"); [/code] Try chaning it to this: [code=php:0]$result = mysql_query("SELECT * FROM site ORDER BY $column LIMIT 20"); [/code] As for what you're trying to do, it's called pagination. [url=http://www.phpfreaks.com/tutorials/73/0.php]Try this tutorial[/url]. Regards Huggie
-
[quote author=thepip3r link=topic=110591.msg447250#msg447250 date=1160064207] $sql = "SELECT * FROM DB WHERE firstname LIKE '%Da%' DESC"; [/quote] This isn't quite accurate. This will correctly identify Someone with a name of narinda, or adam or anyone with 'da' in their name. If you only want ones that start with da, then you want it like this: [code] $sql = "SELECT * FROM DB WHERE firstname LIKE 'Da%' DESC"; [/code] Regards Huggie