Not sure why you'd be trying to accomplish this with mySQL... couldn't you just grab the time from the server serving up the sign up page?
Keeping in mind that by default the month January will actually equal 0 instead of 1.
I recently built something in ActionScript that captured local machine...
I apologize for the tardy reply to all of the helpful responses to my question. 'tis the season :)
I feel I should clarify my particular scecnario, essentially there would be no "loggedIn" session. This particular app will simply run and track interactivity from the user.
If for instance there...
I'd like to redirect a page if the session times out, which is the best method to accomplish this?
Should it be done in the php.ini or the .htaccess file or using the php header(location) on each page?
I have an if statement inside a function that is checking to see if a session has been set
function addNewUser
if (isset($_SESSION['hasrun'])){
do this
}else{
do this
}
The error I get is:
Parse error: parse error, expecting `'('' ... on line 143 which is the first line of the if statement...
This might be a bit of a nube question but here goes.
I have 2 variables I'm multipying
$totalCommission = $numSales * $commissions;
This runs in a foreach loop so let's say I have 2 sales at 9.25 which adds up to $18.50, why is the zero stripped off when I output $totalCommission?
Thanks for your response Geates, I did print_r($promoCode); and here is the result
Array ( [0] => 5 [1] => 7 )
The code below gives me the correct data but twice...
print_r($promoCode);
foreach($promoPk as $promo_Pk){
foreach($promoCode as $promo_Code){
$qVendors = "SELECT...
Thanks Vacunita,
I've actually mad a little progress with nesting the loops. Insead of running two seperate loops I nested the "query" loop inside the first "$promoPk as $promo_Pk" loop.
That being said, I then switch the nested foreach to just a for loop and get this error:
Parse error: parse...
I actually want to combine the results of two for loops, see below
foreach($promoPk as $promo_Pk){
echo $promo_Pk;
}
foreach ($promoCode as $promo_Code){
$qVendors = "SELECT coName,coType,packType FROM vendors WHERE pk = '$promo_Code'";
$result2 = $database->query($qVendors)...
I have what looks to be a very simple problem but I can't seem to see the issue
$q = "SELECT * FROM subscriptions WHERE userID = '".$_SESSION['userid']."'";
$result = $database->query($q);
/* Error occurred, return given name by default */
$num_rows = mysql_numrows($result)...
Hi I have an existing registration form that won't submit after simply adding a primary key to the table. Shouldn't the column just auto_increment as new registrations come in?
The session file is an SSI
function deleteSubscriptions(){
global $database;
$q="DELETE FROM subscriptions WHERE userID = ('".$_SESSION['userid']."' AND promoCode = '".$_GET['pc']."')";
if (!mysql_query($q))
{
die('Error: ' . mysql_error($q));
}
}
Is there anything wrong with the syntax?
While in dev I just used the generic "root" user with no password.
Now that I'm ready to launch I want to switch to a different user or at the very least add a password to the root user.
After adding a password to the root user in the DB and editing the wp-config file accordingly the connection...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.