
Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
String Manipulation- how to preserve new line ... complicated help plz!
Philip replied to physaux's topic in PHP Coding Help
<textarea name"original"></textarea> -
How do you guys like using synergy? I haven't had a chance to play with it before, but I wouldn't mind trying it soon
-
sorry i've been gone ---promise not to ask much questions xD
Philip replied to berry05's topic in Introductions
That part made me laugh Welcome back! -
Upgrade rajivgonsalves to PHP Guru
Philip replied to Gayner's topic in PHPFreaks.com Website Feedback
They have pills for that you know. -
How many monitors do you have? (And if you have several, what configuration do you have them in... like [ 3rd ] [ primary ] [ 2nd ] )
-
This is BS. I mean, I hate IE, don't get me wrong... but it's not like you can't install other browsers on Windows at all. I can still install firefox, chrome, opera, etc, on windows at anytime. I think they are just trying to see how far they can push Microsoft, and get away with it. COME ON?! Really?! Let's just promote a lazy society.
-
I don't know about you guys, but my handbrake wouldn't make a huge difference in stopping power.
-
Porn incognito mode ftw!
-
On that page, after the first paragraph: If you look at the example you'll see the one you were looking at was for functions/procedures: DELIMITER // CREATE FUNCTION SimpleCompare(n INT, m INT) RETURNS VARCHAR(20) BEGIN DECLARE s VARCHAR(20); IF n > m THEN SET s = '>'; ELSEIF n = m THEN SET s = '='; ELSE SET s = '<'; END IF; SET s = CONCAT(n, ' ', s, ' ', m); RETURN s; END // DELIMITER ;
-
Because you're missing "SELECT" from the beginning. CASE is a control flow function, not a data manipulator function like SELECT is. (If I'm wrong, somebody please correct that statement) You'd probably be better off doing this on the other side (PHP or whatever) or make a stored procedure/function to do this.
-
Because CASE WHEN (10>5) THEN (SELECT (5+1)) ELSE (SELECT (1+1)) END Would be suited for a stored procedure/function, and not a query. Try to explain why you want this, because perhaps there is a better way.
-
Instead of IF, use CASE. CASE WHEN (10 > 5) THEN SELECT * FROM contact_chat ELSE SELECT * FROM contact_phone END If is used like IF(CONDITION, DO_WHEN_TRUE, DO_WHEN_FALSE) The mysql doc will show you this
-
That's typically when you try to echo a mysql resource. You most likely need to use mysql_fetch_assoc/array, but without seeing updated code it's hard to know.
-
Set the value of the checkbox to the id of the row.
-
The only reason is because of the array chars (square brackets [ ] ) vs object chars (curly brackets { } )
-
Ah, okay, well do you have a PHP version greater than 5.3.0? If so, you can use the JSON_FORCE_OBJECT option
-
If it's a numerical key, JS will see it as [0], [1],...[n]
-
Take out the header redirects while you are debugging, that'll help a lot. Some notes: == should be = //check if user is logged in $loggedin==0; You should really use mysql_real_escape_string on your inputs Use mysql_error to see if your query has any errors. Use mysql_num_rows to see if any rows were returned before using your while loop.
-
Well, you'd need to change the table name (to inventory), if you have an owner or not (user-specific or if you just want to do a dumping ground for all users), and the timeAdded column to whatever you have your timestamp column named to. Edit: on a side note you could also just have a set number of rows (x) and just update the oldest one each time instead of deleting/inserting for each item.
-
Something like the following? : DELETE FROM table WHERE owner = 1 ORDER BY timeAdded ASC LIMIT 1 Query in English: Delete the oldest row that user 1 owns.
-
Yeah, I've enjoyed watching their tech talks. They have a lot of cool technologies/ideas being used at Facebook. Facebook's debt is pretty large though because of the need for all the servers. Something in the hundreds of millions of USD right?
-
$search_type doesn't have a value set to it (you never did $search_type = 'blah')