-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
the foreach in the loop returns bool(false) though array is present
CroNiX replied to littleangel's topic in PHP Coding Help
Because you foreach as $post in all of them. $post gets overwritten in the inner-loops. Name them different in each loop. -
css/javascript in the HEAD. PHP anywhere (it gets processed before output to browser). noscript where ever you need it (head/body)
-
T_LOGICAL_AND, expecting ')' Syntax Error
CroNiX replied to PintilieVasile's topic in PHP Coding Help
You probably also want to use an OR instead of an AND, otherwise the error will only trigger if both are empty. You'd also want to do that check before you try to add the 2 numbers together. -
T_LOGICAL_AND, expecting ')' Syntax Error
CroNiX replied to PintilieVasile's topic in PHP Coding Help
Around line 5: if (empty($num1 and $num2)) { Error: unexpected T_LOGICAL_AND, expecting ')' The error is saying that it doesn't expect the AND there, and it's expecting a ) instead. This is because empty() only accepts one argument, so you need to split that into two empty() statements. if (empty($num1) AND empty($num2)) -
PHP If, While, Array for all Combination in the post
CroNiX replied to emmontenegro's topic in PHP Coding Help
I don't know what you mean. -
PHP If, While, Array for all Combination in the post
CroNiX replied to emmontenegro's topic in PHP Coding Help
Only 672 combinations -
PHP If, While, Array for all Combination in the post
CroNiX replied to emmontenegro's topic in PHP Coding Help
foreach($space as $s) { foreach($location as $l) { foreach($ageGroup as $a) { foreach($duration as $d) { foreach($footfall as $f) { echo "$s, $l, $a, $d, $f = SOMETHING HERE<br>"; } } } } } -
Character encoding problem. Got strange characters in my database
CroNiX replied to Fluoresce's topic in PHP Coding Help
You should convert your tables to utf8 as well. -
Page containing PHP and MySQL loading slowly - need advice
CroNiX replied to NiallAA's topic in PHP Coding Help
In addition to the above, make sure your db is properly indexed. Old, but good read: http://www.databasejournal.com/features/mysql/article.php/1382791/Optimizing-MySQL-Queries-and-Indexes.htm -
[PHP, HTML, Apache (XAMP)] Inline PHP Tags Do Not Get Processed
CroNiX replied to glassfish's topic in PHP Coding Help
That's not true. You can tell apache to parse any file extension as php, but Apache has to be set up that way using the AddType directive. -
did you try to echo pathinfo("uploads/$fuser/$file", PATHINFO_FILENAME) to see what the value is? I bet its a full filename and not just the extension. Probably want to be using PATHINFO_EXTENSION there
-
Not sure why that worked and what I had in my last post didn't. They look the same to me Oh, maybe you tried it before my edit.
-
try: json_decode($response->GetProspectAsJSONResult, true)
-
http://php.net/manual/en/function.json-decode.php
-
We use a last_activity field that gets autoupdated whenever the user does something. Then we just look for users active in the last x minutes to determine who is online. Obviously not 100% accurate, but avoids some of the problems that ginerjm refers to. last_activity timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
-
You don't need a loop at all. Just grab all results. http://php.net/manual/en/mysqli-result.fetch-all.php
-
Create a form for them to input the data?
-
Instead of: $sqlError = "Error writing to database\n"; Which tells you nothing useful, grab the actual error from mysqli $sqlError = mysqli->error;
-
It's not really any use trying to update this as it's already deprecated code! mysql extension will not be available in a future version of php, so even if you get this code working it won't work for very long into the future unless you never plan on upgrading PHP. Use mysqli or PDO db driver.
-
Probably because the php versions are different and have different extensions enabled
-
You don't need to replace the question mark
-
It means you don't have the mysqli extension enabled in your php.ini.
-
Another thing, why are there php tags wrapping your jquery $.post()?
-
Where are these values coming from? $.post( "send.php", { zProduct: zProduct, zBay: zBay, zMeasures: zMeasures, zDoor: zDoor, zPlinth: zPlinth, zMount: zMount, zBattery: zBattery} ); Also, if you are using jQuery, why are you doing this stuff? document.getElementById('abc').style.display = "block"; document.getElementById('formtable').hidden=true; document.getElementById('DivDesc').hidden=true; document.getElementById('DivSend').hidden=true; document.getElementById('DivSum').hidden=true; When you could just $('#abc').css('display', 'block'); $('#formtable, #DivDesc, #DivSend, #DivSend').hide();
-
post your current code