Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
9
Posts with Upvotes
7
Upvoting Members
9
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
7 Commented Posts
0 Endorsements
Ranked #1K
~19.9K People Reached
About Me

Senior PHP/Mysql developer, senior CSS, JavaScript - jQuery and AJAX developer

Interests
New media, movies, swimming, going out
Favorite Tags
Member Avatar for aniltc

[code=php]<?php $string = 'But i am not looking this simple one. what i am looking here is i searched a keyword (for eg php ). After searching I got some results from the database. if the result has a keyword php, then that all (php) word should be highlited. please …

Member Avatar for kodegeek
0
282
Member Avatar for BigFormat

Your regex pattern has two problems: 1. it has * as the character counter, which means "0 or any number of charcaters frm the class". This means that a string containing even none (0) of your characters will match your expression 2. you didn't specify that there cannot be other …

Member Avatar for BigFormat
0
167
Member Avatar for computerfox
Member Avatar for andydeans

Are you sure you have records that match all the joins at the same time? Cause there is nothing wrong with the query. Try using LEFT JOIN instead of JOIN and see what it returns. This will return all the rows in your clients table and either fields with data …

Member Avatar for johny_d
0
104
Member Avatar for frugalfreeloade

This works, of course, but it's not a very elegant solution and if you have many checkboxes on the page than (say 50) you will have to write that code 50 times, which I don't think you'll like :) So, another easier solution is to set the names of the …

Member Avatar for metalix
0
209
Member Avatar for sallecpt

Counting for locations: [CODE=mysql] SELECT COUNT(*), fieldID, fieldValue FROM itemfield WHERE fieldID = 8 GROUP BY fieldValue [/CODE] just change the fieldID with the ID of other counting criteria (dwelling type, make, etc)

Member Avatar for sallecpt
0
151
Member Avatar for dan_ord

If this si what you want - to have all the attribute values in a comma separated string - then you just have to do an implode (no loop) to $attribute: [CODE=php] $att_ref = implode(",", $attribute); [/CODE] But id don't understand why you don't just assign the whole $attribute array …

Member Avatar for NettSite
0
71
Member Avatar for dragos13

Use array_slice function Read here how: [URL="http://php.net/manual/en/function.array-slice.php"]http://php.net/manual/en/function.array-slice.php[/URL] You should read the php manual first and learn th basic stuff from there, and then go and start programming!

Member Avatar for johny_d
0
59
Member Avatar for muralibobby2015

mysql_query("DELETE p.*, t1.*, t2.*, t3.*, t4.*, t5.*, t6.* FROM product AS p, table_1 AS t1, table_2 AS t2, table_3 AS t3, table_4 AS t4, table_5 AS t5, table_6 AS t6 WHERE p.id = $product_id AND t1.product_id = $product_id AND t2.product_id = $product_id AND t3.product_id = $product_id AND t4.product_id = $product_id …

Member Avatar for johny_d
0
91
Member Avatar for cmhampton

You would probably have to loop through the resultset and assign each row to an array; you can't just split the resultset; it might be easier/faster to just have to queries with their own resultset

Member Avatar for cmhampton
0
115
Member Avatar for Carrots

Why do you have to use replace? Cant you just append the random password to the and of the string without XXXXX ? Like this [CODE=php] <?php $password = rand(12345,98765); $stringtoparse = 'Your new password is ' . $password; echo $stringtoparse; ?> [/CODE]

Member Avatar for cwarn23
0
101
Member Avatar for ss.jatinmehta

Hi, Have you found a solution for this yet? If not, then... 1. can you put the three tables in a zip and attach them here so I can replicate them locally and try some changes? and 2. 'gold' in this query is just an example for any dynamic input …

Member Avatar for rch1231
0
138
Member Avatar for dragos13

Actually, what colweb said will not end up with what you want, since your implode will put a comma between elements from each row, but will results from different rows wil not have a comma between them. The double values you get is from the fact that you use mysql_fetch_array …

Member Avatar for johny_d
0
93
Member Avatar for x86phre3x

Here's a very simple mysql solution: [CODE=php] <?php mysql_query('UPDATE dealers AS d, (SELECT agent, COUNT(*) AS agentcount, registration_timestamp FROM users GROUP BY agent) AS u SET d.thisperiodusercount = u.agentcount + d.usercountbalance WHERE d.username = u.agent AND u.registration_timestamp > d.registration_timestamp AND u.registration_timestamp < d.expiredtime') or die(mysql_error()); [/CODE] I'd suggest you don't …

Member Avatar for johny_d
0
131
Member Avatar for dragos13

That's because the graph class you use to output the image is trying to set some image headers, but you already outputed some stuff (from your print commands) before it, which php don't allow. So: 1. This should fix your error: remove all the prints before phpgraphlib.php; leave only the …

Member Avatar for metalix
0
143
Member Avatar for Conielo

It's probably because you don't have the $dbc available inside that function; you have to either pass it as a parameter to the function like: function($dbc) { .... or set it as a global variable inside that function like: function() { global $dbc; .....

Member Avatar for johny_d
0
176
Member Avatar for Mestika

[CODE=mysql]UPDATE user AS u, thread AS t, threadoffering AS to SET u.points = u.points * 1.05 WHERE t.threadid = to.threadid AND to.year = 2010 AND to.season = 'spring' AND t.threadLocation = CS AND to.user = u.userid AND u.userid > 1 [/CODE] You have to join somehow user table to threadoffering …

Member Avatar for drjohn
0
346
Member Avatar for dudegio

You can find it in the php manual if you do a little search :) Here is that code adjusted to what you need: [php] <?php /// here is your database connection /// than the query $result = mysql_query ("select field_1, field_2, field_3 from table") or die (mysql_error()); $filename = …

Member Avatar for candlelight
0
118
Member Avatar for rajeesh_rsn

You can do it like that, but that's not the optimised way to do it. You have what is called multiple-to-multiple relationship (many users with many hobbies). So the principle to connect one to the other is to have a table that defines each one (one table for users and …

Member Avatar for mwasif
0
112
Member Avatar for Syakoban

Actually, [B]kkeith29[/B] example doesn't load new content in the original page; it just reloads the page with a parameter passed through the $_GET variable, and shows some text as a response of that parameter. Since php is a server side script, which means it is processed on the server and …

Member Avatar for aformoftruth
0
326
Member Avatar for ned69

Try this: [CODE]<a>a href="results.php?fl=A">A</a> <a>a href="results.php?fl=B">B</a>[/CODE] [CODE] $fl =$_GET['fl']; // fl - First Letter if (preg_match('#^[a-z]{1}$#i',$fl)) { // check if it is an allowed value - letters from a to z in lower/upper case $result = mysql_query("SELECT id,high_school FROM high_schools WHERE high_school LIKE '$fl%'"; ...... } [/CODE] For that code …

Member Avatar for ned69
0
107
Member Avatar for maninweb
Member Avatar for jmag
0
7K
Member Avatar for djwakko18

You have a problem in the way your query string is written (because of the way you wrote it, you missed some spaces, between [B]auth[/B] and [B]where[/B] and between [B]'$userid'[/B] and [B]and[/B]: [code]$query="select * from auth" ."where name='$userid'" ."and pass=password('$password')";[/code] this query is, in fact, this: [code]$query="select * from authwhere …

Member Avatar for johny_d
0
127
Member Avatar for Pro2000

First of all, why do you require the "Wordsarray.php" file in each cycle of the while loop? You should include (require) that file only once, before the loop and than do the while loop. Than, about your error, I can only guess here, since you didn't provide the $normal and …

Member Avatar for Pro2000
0
185
Member Avatar for jtmcgee

[quote]$item = [B][COLOR=green]mysql_fetch_array[/COLOR][COLOR=green]([/COLOR][/B]$item_query[B][COLOR=green])[/COLOR][/B];[/quote] means $item is an array an you cannot put an array in an echo statement; this is why you get nothing. You need to use $item['name_of_mysql_column'] in your "echo...." You also have a sintax error: in [quote]$foo =& creature_stats[B][COLOR=green]([/COLOR][/B] item, $id_creature [B][COLOR=green])[/COLOR][/B];[/quote] since item is a variable, …

Member Avatar for somedude3488
0
159
Member Avatar for agrothe
Member Avatar for johny_d
1
122
Member Avatar for trs21219

If you use mod_rewrite, why don't you use it all the way??? RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([0-9]+)/$ index.php?act=$1&task=$2&game=$3 or RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([0-9]+).html$ index.php?act=$1&task=$2&game=$3 That would be: mysite.com/games/play/534/ or mysite.com/games/play/534.html or whatever other variation of that you want ;)

Member Avatar for johny_d
0
162
Member Avatar for binoj_daniel

Here's a statistic from one of my sites, but I can tell you that is about the same from all my other sites: [B]1024x768 (45.9%)[/B] [B]1280x800 (12.3%)[/B] [B]800x600 (10.4%)[/B] [B]1280x1024 (9.7%)[/B] [B]1152x864 (3.2%)[/B] [B]1280x768 (2.2%)[/B] [B]1680x1050 (1.9%)[/B] [B]1400x1050 (0.5%)[/B] [B]1280x960 (0.7%)[/B] [B]Others (13.2%)[/B] As you can see, most of the …

Member Avatar for johny_d
0
84
Member Avatar for Mosqwik

<title><?php echo $title; ?></title> where $title has a value returned by your php script; for instance: the title of an article from the database, the name of the current category, the name of the site if you are in the homepage etc.; look at this forum for example.

Member Avatar for johny_d
0
67
Member Avatar for pbpyrojust

You pobably have a sintax (writing) error in your 'header.php' file; check that you have closed all the brackets and parenthesis and also that you have sthe ';" at the end of every line of code etc. Yu also might have a wrong path to the file: '/php/header.php' means the …

Member Avatar for johny_d
0
163