-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Keep a counter that starts at 1 and increments for every table cell you output. At the beginning of the loop, if the value is 1 then output a . At the end of the loop, when the (new) value is 5 then output a and reset to 1, otherwise just increment. After the loop be sure to clean up any incomplete row you may be in the middle of outputting: if the counter is >1 then output however many cells it takes to get the counter back up to 5 (keeping in mind that counter=2 means you need four cells, not three).
-
It is sorting. Why do you think it isn't?
-
If you use / delimiters then you have to make sure you escape them inside the expression (or not even use them at all). ~ and # are common alternatives. "#([^[])/me([^\n\r$]*)([\n\r$])#"
-
The HTML you want looks like CYHZMake sure you have ABBRs styled to give some visual indication that you can hover over them. By default browsers will give a dotted underline and maybe a special mouse cursor (on hover).
-
Jacques still has a point of trying to make things work without Javascript whenever possible. There are people out there who block all Javascript and have a thing against whitelisting sites. It's not wise to alienate demographics. Anyways. Make your form look like a real form, with a and submit button and all that stuff. Even if its action doesn't go anywhere for now. Then add in an onsubmit handler (for the form or the submit button) that stops the regular action and does the AJAX instead.
-
What's your form and AJAX code? Are you using an actual submit button with an onsubmit handler?
-
mysql_fetch_assoc() Only returning 1 value instead of all of them.
requinix replied to MstrGmrDLP's topic in PHP Coding Help
Because you only got one row. If you want all of them then you need to put the mysql_fetch_assoc() stuff into its own while loop. But that's not very efficient. You could just execute one query to get all the user information for all the friends. SELECT users.user_name, users.user_pic, users.user_id FROM users JOIN friends ON users.user_id = friends.friend_user_id WHERE friends.user_id = that id you have in the sessionOne while loop. -
Yes. It totally should.
-
The column is propid and it's in the user_assignments table? You don't need to DISTINCT anything. Select from the projects table (the one that has a list of all the projects) then LEFT JOIN it with the assignments table on the matching project ID and the correct user ID, then keep everything that failed to join. SELECT p.id FROM projects p JOIN user_assignments ua ON p.id = ua.propid AND ua.userid = 'abc123' WHERE ua.id /* or another column in that table */ IS NULLIf you're getting poor performance out of the query, that's a different problem... [edit] Above should say LEFT JOIN. Like I did in the description before it.
-
Probably. What "certain areas"?
-
That else you have for the commissionRate stuff? Its closing } is in the wrong place. The indentation is a reminder for it. if ($qtySold >= 100){ $commissionRate = 0.03; }else{ $commissionRate = 0.02; // should go right hereActually what you've described doesn't match up with what the code says, but the brace } thing is a bug. The php.ini. Those two things are settings in the php.ini. You know what, don't worry about it.
-
Are you talking about subtraction? $total_visitors = max($visitors_online->count_users() - $online, 0);max() just in case your database disagrees with usersOnline::count_users() about how many people are online.
-
Protip: when developing with PHP, make sure you have your environment set up to warn you about potential (or actual) problems. Open your php.ini, then find and change the values for two settings: error_reporting = -1 display_errors = onThen restart your web server. After that, your script should output warnings about how "commissionRate" is undefined. Twice per script, it seems. The problem is that the two lines that try to define it, aren't. ($commissionRate == 0.03);Putting aside how the parentheses are pointless, == is for comparison. You want = for assignment. $commissionRate = 0.03;Change the other one too.
-
If it is doing that then the first query is returning multiple rows. Have you checked that yet?
-
Have you verified that you data reflects what you think is supposed happen? It looks to me like there are three separate calendar entries, each with a different code. And your code shows a "Rank: Code" format that isn't shown in your output. Which does have stray commas in the Duty lines. Ha, ha, "duty".
-
Well, what is the value of the REQUEST_URI then?
-
The REQUEST_URI will be whatever you see in the browser, not counting the domain name or a #anchor. So are you sure that it should be comparing against "/home.php" and not "/{url}/home.php" (whatever that {url} value may be)?
-
How to change the pagination url in httacces
requinix replied to Tasos's topic in Apache HTTP Server
Well, for one, it doesn't match what you described. You said "fun/page/1" but your RewriteRule says "fun/page/stuff/1". And that "stuff" isn't going into the replacement URL so I guess it doesn't matter? Looks like it's supposed to be the search term though?- 1 reply
-
- .httacces
- pagination
-
(and 1 more)
Tagged with:
-
1. echo $date;That's where the problem was. You have to use something like $date->format(...) to get output. 2. Yes, they are predefined.
-
Also know that you have to match the existing cookie's domain and path parameters. So the checklist is: Calling setcookie() before any output Giving an expiration time in the past (not necessarily a negative number, just something ) Same domain as before Same path as before
-
So you haven't been able to find a way to insert a
-
preg_replace - How to use variables in your replace string
requinix replied to CrimpJiggler's topic in Regex Help
Not in the replacement string. If there were $s or \s though, they could cause a problem. It looks fine to me. What are the exact values of $match, $replace, and $content before and after? If you're outputting them to HTML, be sure to look at the actual source of the page and not what your browser's DOM inspection thing may show. -
Trying to convert set of $_post variables to date to save
requinix replied to learningPHP1's topic in PHP Coding Help
No, the result is "2014-04-2221:02:17". Which should explain why strtotime() couldn't understand it. -
preg_replace - How to use variables in your replace string
requinix replied to CrimpJiggler's topic in Regex Help
What is the value of $diagramPath? /e or not won't make a difference because you're doing the replacing just after defining the replacements - the value in $replace would be the same value during the /e execution.