-
Posts
307 -
Joined
-
Last visited
Community Answers
-
TapeGun007's post in PDO version of num_rows? was marked as the answer
@gizmola, Yes, I just read that actually on a website, but I tried this instead and it seems to work fine (more along the lines of what Jacques suggested). I want to simply check for any data so it doesn't bother building out a table for nothing.
$stmt = $con->prepare($sql); $stmt->execute($params); $row = $stmt->fetch(PDO::FETCH_ASSOC); if ($row){ echo "<br>Not Empty<br>"; }else{ echo "<br>Empty<br>"; } -
TapeGun007's post in Can you store $con into an array? was marked as the answer
I think I have it already... I was too quick to post. I see my syntax error above as well.
I think this will work:
foreach($statedb as $x => $x_value){ $con[$x] = new mysqli($DBServer, $DBUser, $DBPass, $x_value); } -
TapeGun007's post in Masked Input was marked as the answer
Wow.
I changed this line
jQuery(function($){
Now it works...
-
TapeGun007's post in Comparing time to a timestamp was marked as the answer
benanamen,
It's quite simple (supposedly):
I have a table called "Security"
Security
----------
ID
SalesID
SecurityAnswer
TimeRecord
TempCode
Attempts
LoginSecurityID
All I want to do now (regardless of what I posted previously) is check if the TimeRecord is less than 20 minutes. I need to also ensure that the TempCode matches, and the ID is correct.
"SELECT * FROM LoginSecurity WHERE timestampdiff(minute, TimeRecord, CURRENT_TIMESTAMP()) < 20 AND SalesID = '$ID' AND TempCode ='$temppassword'
I've tried CURRENT_TIMESTAMP, and I tried using Now()....it just doesn't seem to work and so I know it's a syntax thing.
To test I'm running the following after the query:
$rs=$con->query($sql); $rs->data_seek(0); $row = $rs->fetch_assoc(); if($row > 0){ echo "Record found"; }else{ echo "Record not found"; }