pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
$InsetLog = mysql_query("INSERT INTO userlogs (UserID, Log, `Date`) VALUES ('{$_SESSION['Current_User']}', '$Username failed to logged in.', '$Date')") or die(mysql_error());
-
Cannot retrive all items from database
pocobueno1388 replied to k0rnonthek0b's topic in PHP Coding Help
Nope...not in there either. it would look like this <?php function sqlQuery(){ //code in between } ?> -
Cannot retrive all items from database
pocobueno1388 replied to k0rnonthek0b's topic in PHP Coding Help
If thats where the function is defined, then yes. -
Cannot retrive all items from database
pocobueno1388 replied to k0rnonthek0b's topic in PHP Coding Help
Still not the function... The function is probably defined in _prepend.php. -
Cannot retrive all items from database
pocobueno1388 replied to k0rnonthek0b's topic in PHP Coding Help
No yoru sqlQuery function, not your table structure. You use it in your code like this SQLquery("SELECT * FROM activities"); We need to see what that function looks like. -
Just like you already put http://www.uberpilotdudes.com/Calendar.php?action=1
-
You could do this <?php if (isset($_GET['action'])) $month = $_GET['action']; else $month = date(n); ?> Now if action is set in the URL, it will display that month. If there is no action, it will display the current month by default. Is that what your after?
-
Did you try changing what I told you to? Your going to have to explain that a little more...
-
Oops, sorry...thats what I meant
-
Change $month = echo date(n); To $month = date(n); ---------------------------- Change <iframe src ="Calendars/<?php $month ?>.htm"> To <iframe src ="Calendars/<?php echo $month; ?>.htm"> So your files are named like 1.php, 2.php, etc, right?
-
You had quite a bit of missing stuff. You didn't have an opening form tag, and your submit button didn't have a name. Also, your PHP logic was a bit messed up. So try this and see if it is what you want <html> <head> </head> <body bgcolor="#FFCC00"> <div> <font face="Arial" size="2"> <table border="0" width="100%" id="table1" bgcolor="#FFFFFF"> <tr> <td width="126"> <table border="0" width="107%" id="table2"> </tr> </table> </td> <td width="797" valign="top"> <td> </td> <td width="434"> </td> </tr> </table> <font face="Arial" size="2"> <form method="post"> <table border="0" width="67%" id="table4"> <tr> <td> </td> <td width="434"><font face="Arial" size="2"> Please place your email address here: <input name="email" type="text"> <br> <br> Please write your message to here, and we <br> will contact you shortly:<br> <textarea name="message" rows="2" cols="40"></textarea><br> <input type="submit" name="Submit" value="Click here to send your email!"> <br><br>(If the text has cleared from the form fields, <br>your email has been sent successfully. <br>Please do not reclick.) </font> <p align="left"><font face="Arial" size="2"> </td> </tr> </table> </font> <p align="center"></p> </form> <p align="center"> </p> <p></td> </tr> </table> </font></div> <?php if (isset($_POST['Submit'])){ if (isset($_POST['email']) && $_POST['email'] != ""){ $to = "email@mydomain.com"; $subject = "Website Email"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if ($sent) { print ""; } else { print "We encountered an error sending your mail"; } } else { echo "You didn't fill in your email!"; } } ?> </body> </html> Also note that any messages will appear at the BOTTOM of your script since your PHP code is at the bottom. I wasn't sure if you wanted it like that, so I left it.
-
Change this line if (mysql_num_rows($result_a)) To if (mysql_num_rows($sql))
-
You executing the query twice. Change this line $result_a = mysql_query("SELECT * FROM authortoperson WHERE feed_id = '$feed_id' AND entry_id = 0 "); To $result_a = "SELECT * FROM authortoperson WHERE feed_id = '$feed_id' AND entry_id = 0";
-
I did more than take out the unnecessary PHP tags. Can you post you form?
-
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
DUH! I am having all sorts of brain farts today >.> $query = mysql_query("SELECT u.username FROM users u INNER JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND u.username='insert_username_here'")or die(mysql_error()); Put the username where it says "insert_username_here". -
Try <?php if (isset($_POST['Submit'])){ if (isset($_POST['email']) && $_POST['email'] != "") echo '<h1>Thank you for filling out this form!</h1>'; else echo "Please fill the email field out"; } else { $to = "email@mydomain.com"; $subject = "Website Email"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if ($sent) { print ""; } else { print "We encountered an error sending your mail"; } } ?> [code] [/code]
-
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
I was thinking you might be back with that question Lets try an INNER JOIN instead. $query = mysql_query("SELECT u.username FROM users u INNER JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE)")or die(mysql_error()); -
[SOLVED] Help Unknown column '$thisID' in 'where clause'???
pocobueno1388 replied to sun7777's topic in PHP Coding Help
Try this $query = "SELECT Restaurants.ID, Restaurants.Name, Restaurants.Phone, RestAddress.Address, RestCategories.Name AS Categories FROM ((Restaurants INNER JOIN RestAddressMap ON Restaurants.ID = RestAddressMap.RestaurantID) INNER JOIN RestAddress ON RestAddress.ID = RestAddressMap.RestAddressID) INNER JOIN RestCategories ON RestCategories.ID = Restaurants.CategoryID WHERE Restaurants.ID = '$thisID'"; $result = mysql_query($query)or die(mysql_error()); -
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
Oops, I don't know why I put "MIN" instead of "MINUTE", haha. Change it to $query = mysql_query("SELECT u.username FROM users u LEFT JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE)")or die(mysql_error()); -
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
Change it to $query = mysql_query("SELECT u.username FROM users u LEFT JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MIN)")or die(mysql_error()); -
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
Okay, try this query. Make sure all the field and table names are correct SELECT u.username FROM users u LEFT JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MIN) -
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
It's because your query isn't right. You said that "active_users" is the name of another TABLE, right? If it is, then you can't use it in your query like it's a row in whatever table the username is in. What is the name of the table that stores the username, and what is the table structure of the "active_users" table? -
[SOLVED] Check box ticked if database result is present
pocobueno1388 replied to adam291086's topic in PHP Coding Help
You could do this <?php if ($row['col'] == 'home') $checked = "checked='yes'"; else $checked = ""; echo "<input type='checkbox' name='name' value='val' $checked>"; ?> -
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
Your not connected to the database. Also add a or die(mysql_error()) to the end of your query. -
[SOLVED] MySql Pulling Data, PHP IF statment
pocobueno1388 replied to Lamez's topic in PHP Coding Help
Well, assuming you have some sort of "last active" field in the database, you could do this. <?php $query = mysql_query("SELECT username FROM table WHERE username='Lamez' and last_active < (NOW() - INTERVAL 5 MIN)"); if (mysql_num_rows($query) > 0){ echo "Online"; } else { echo "Offline"; } ?>