Jump to content

Presto-X

Members
  • Posts

    187
  • Joined

  • Last visited

About Presto-X

  • Birthday 10/11/1978

Profile Information

  • Gender
    Male
  • Location
    Portland, OR

Presto-X's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Thanks guys, I will give that a shot, thanks Jessica. TOA, yes, but it is less annoying to keep seeing the same image back to back
  2. Hey guys, I'm stumped, I'm trying to pull in a (as in 1) random image from a dir each time the page loads, I have that part down, but what I am having problems with is, if there are only 5 or so images in the folder, you have a 1 in 5 chance that the same image will get displayed twice. How can I keep this from happening? header("Content-type: image/jpeg"); $img = glob('images/*.{jpg,jpeg,png,gif}', GLOB_BRACE); $img = $img[array_rand($img)]; imagejpeg(imagecreatefromjpeg($img));
  3. So I just set the userid, seminarid, and action columns as primary keys, and changed my query to the following, still no go: INSERT INTO conferences_seminar_sessions (userid, eventid, theaterid, seminarid, action) VALUES ('816', '1', '1', '6', '1') ON DUPLICATE KEY UPDATE created=VALUES('2012-12-27 07:03:40')
  4. Hey guys, thanks for the replies. So here is my query SQL=INSERT INTO conferences_seminar_sessions (userid, eventid, theaterid, seminarid, action) VALUES ('816', '1', '1', '6', '1') ON DUPLICATE KEY UPDATE VALUES (userid='816', eventid='1', theaterid='1', seminarid='6', action='1'); What I need to do is make sure that the user has not already signed in to a seminar, if so do nothing or just update the current row with the current timestamp ether of these options work what ever is easier. So I'm guessing I need to check if the user has checked in to the seminar and if the action matches (1=checked in, 2=checked out). So check if userid, seminarid, and action match any other row. Should I be doing a query first to look if there are any matches if not add a new row, if so update the current row?
  5. So if I set the userid, eventid, theatherid, and seminarid as primary keys and remove the key and auto increment from the id column it seems to work, but I want auto increment on the id column :-\
  6. Or maybe I should be using REPLACE INTO or maybe even INSERT IGNORE INTO? heck I don't know lol
  7. Hello guys, I’m trying to build a query that adds a user’s check in / out date and time in to the database, basically I need to check if 5 columns match if so update the row, if not add a new row. I thought this was going to be easy but after a few hours of reading, I am still not able to get the query to work *sigh* This is how my table is built: CREATE TABLE `conferences_seminar_sessions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL, `eventid` int(11) NOT NULL, `theaterid` int(11) NOT NULL, `seminarid` int(11) NOT NULL, `action` tinyint(1) NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; And this is my query: $query = " INSERT INTO cswconferences_seminar_sessions (userid, eventid, theaterid, seminarid, action) VALUES ('" . $userid . "', '" . $eventid . "', '" . $theaterid . "', '" . $seminarid . "', '" . $action . "') ON DUPLICATE KEY UPDATE userid=userid+'" . $userid . "' AND eventid=eventid+'" . $eventid . "' AND theaterid=theaterid+'" . $theaterid . "' AND seminarid=seminarid+'" . $seminarid . "' AND action=action+'" . $action . "' ;";
  8. Hello guys, I built this site atop Joomla 2.5 using Twitter bootstrap v2.0.3 at the start of the year and it has been running great, I tested it on all of the latest browsers, iPhone, and iPad all seem to be working great, however I have gotten reports that it does not load on android devices and I cannot find anything that would cause the site not to load. I downloaded the latest android sdk to use the browser emulator and it loaded the site just fine, I'm stumped, does anything in the code jump out at you that would cause the site from loading? http://www.shawnlindsay.org
  9. I completely agree with you guys, I think its a stupid idea, but my boss and all of his wisdom wants the users to use their real company email address. Gizmola, thanks I did not even think of that lol I will get it added.
  10. Hello guys, I'm trying to restrict free email providers domain's from our sign up form so they have to use their company's email address not their free spam email account. Below is the code I have written so far, it seems like it would work, and it seems to work most of the time, but from time to time one or two will slip in, how is that possible? $domains = array('gmail','msn','yahoo','hotmail','excite','lycos','aol','inbox','fastmail','mail','maricopa','care2','zenbe','gmx','gawab','goowy','hotpop','mybestmail','bigstring','live','comcast','cableone','qwest','earthlink','netzero','clearwire','mybluedish','wildblue','clear'); $emailDomain = explode('@',$_POST['email']); $emailDomain = explode('.',$emailDomain[1]); if(in_array($emailDomain[0],$domains)){ $error_msg = 'Sorry your email\'s domain is not allowed, please use your associated company email.'; }else{ // Add the user to the database. }
  11. Hey guys, I'm working on a Google map with multiple locations, it seems to be working fine, what I want to do is have an HTML list of the locations below the map (also working fine) with a view button, when you click that it will open the infowindow attached to the correct marker on the Google map. I really suck at JavaScript and have not been able to get this working, I'm a PHP guy lol Here is a link to what I have so far: http://jsfiddle.net/Presto/Ch3bz/ Please any suggestions would be greatly welcome, thanks everyone.
  12. Thanks for the replies, So with PHP would I do something like: function getTwitterStatus($userid){ set_time_limit(2); $url = 'https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=' . $userid . '&count=1'; $xml = simplexml_load_file($url) or die("could not connect"); foreach($xml->status as $status){ $tweet = array( 'created' => how_long_ago(strtotime($status->created_at)), 'text' => $status->text, 'username' => $status->user->screen_name); } return $tweet; }
  13. Hey guys, I'm working on a script that pulls my latest tweet from twitter, the script seems to work really well, the only problem that I found, is when twitter is overloaded the script times out, but you have to wait like 30 sec. for the page to load to tell you that. Is there away to set a timeout of like 2-3 sec. then if its not done kick out a nice error message, or better yet read from a local cache file? Here is my current script: function getTwitterStatus($userid){ $url = 'https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=' . $userid . '&count=1'; $xml = simplexml_load_file($url) or die("could not connect"); foreach($xml->status as $status){ $tweet = array( 'created' => how_long_ago(strtotime($status->created_at)), 'text' => $status->text, 'username' => $status->user->screen_name); } return $tweet; }
  14. Hello guys, I like serching for the answer before posting as most of our questions have already been asked before but when I try searching I get the following error: Is this an issue with my account or with the forum? Is anyone else having this problem? Thanks guys.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.