-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Zane
-
Well if it didn't print out a 2-d array you would only get one row from that select all.. is that what you're after This right here is what is making the 2D array... the little braces after out $out[] = $results; If you just want a 1D array then take them off $out = $results;
-
$Dorky = new Dorky(); $Dorky->askQuestion(); $Dorky->becomeInfuriated($responses); $Dorky->exitAndLock(); $Dorky->respect--;
-
List visitors between two dates. But also ouput "empty" dates in same query.
Zane replied to gladideg's topic in MySQL Help
use an OUTER JOIN instead of an INNER JOIN -
You need to look at the $_SERVER superglobal it's an array that has all this information (that you don't need to ask people for).... here's an example http://zanedockery.com/temp/server.php If you look at these keys you'll find the Time Zone and the IP of the user/viewer
-
INSERT INTO users[NEED A SPACE]('sb_post') VALUES[NEED A SPACE]('$post1') WHERE username='$naam'
-
What do you mean it won't work
-
[SOLVED] array inside a function..getting syntax error
Zane replied to drumhrd's topic in PHP Coding Help
function filecheacker ( { return $imageinfo; ) -
both are the same thing... replace split with explode
-
####### #######
-
yeah, didn't think about the other layers part. sorry
-
http://www.phpfreaks.com/forums/index.php/topic,271192.msg1280199.html#msg1280199
-
php/mysql auto logout after 2 hour and reset password
Zane replied to jarvis's topic in PHP Coding Help
$_session['timein']=time(); $maxTime = 600; // this is 10 mins in secs. $tot_time = time() - $_session['timein']; if($tot_time > $maxTime) { session_destroy(); header("Location: logout.php"); } ?> This won't work but it's the write idea. It won't work b/c $tot_time will always be 0 therefore $tot_time will always be less than $maxTime... in turn NEVER destroying the session. Something more along the lines of $_SESSION['timeIn'] = (isset($_SESSION['timeIn'])) ? (((time() - $_SESSION['timeIn']) -
You have you DB structure all wrong.. If your apartments can only have on type then you should put that as an attribute (another field) in the apartments table. Not link them in another table. If you have multiple appliances in multiple apartments, then link each appliance to its apartment. i.e put the apartment as an attribute to the appliance. So now.. it should look something like apartments apartmentID apartmentName apartmentTypeID apartmentType apartmentTypeID apartmentTypeName appliances applianceID applianceName apartmentID Next part is linking them together .... which I'm no good at.
-
php/mysql auto logout after 2 hour and reset password
Zane replied to jarvis's topic in PHP Coding Help
Three way to do this #1 You can use cookies instead. With cookies you can set the lifetime of that particular cookie instead of changing your permanent PHP settings #2 You can store the page load/execution time in the SESSION...... you know... every page load that happens. Just overwrite it.. over and over.. comparing it all the while with the current time. #3 Create a table of actions in a database and check it everytime the page is loaded. Pretty much the same thing as the session except you'll have records to keep of everything. -
delimiters are something you use in PCRE regex (the "preg functions") other than POSIX regex (the "ereg functions") for example.. $string = "I eat deer" preg_replace("/deer/", 'dogs', $string); would be done like this in "ereg" form $string = "I eat deer" ereg_replace("deer", 'dogs', $string); notice the difference? the slashes. // you can also use !@#$%^&* (all those wacky characters where the numbers are... holding SHIFT) what's the strategy in it? To keep you from having to escape slashes.
-
What exactly made you choose XML over a database connection again? If you own the server(s) then there should be no problem connecting the two. Even if it is two servers.. simply allow one to connect to the other...and it's as simple as mysql_connect("hostsite.com",'username','password') or mysql_connect("inhouse.net",'user','pass');
-
damnit!.. I knew there was no point in reading this.
-
yeah.. that and the reason why it's the mobo. I'd hate to hear that someone threw away an AM2 motherboard because the BIOS isn't keeping or a jumper was set wrong. Just unplug all that shit..all you really need for the computer to actually "work" is a keyboard..... and if you want to see stuff.. then a video card. .. Process of elimination. If that doesn't work.. well, you should know by then what it is.
-
...bummer I've had this same thing happen to me plenty of times but alas .. it's never the same solution. The first thing I do when this happens is I unplug all the Molexes. hard drives, cdroms, floppy?, LEDs, anything that isn't .. THE COMPUTER aka the Motherboard displayer machine as I like to call it. ------Assuming everything's unplugged now----- If you have to reset the CMOS every time then it's obviously not getting enough power to do it itself..which is only 3v or so. So either you have a short somewhere or the PSU is dying (since you've already made it clear that the CMOS battery isn't) .. Haven't really read the above posts so I may be repeating something so I apologize beforehand...
-
you think maybe your CMOS battery is just dying?
-
$result = mysqli_query(${'cxn' . $x}, $sql);
-
Sure, I'll unlock it