Jump to content

dfowler

Members
  • Posts

    223
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dfowler's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Thank you so much! I knew I was overlooking something. I always forget about the reserved words.
  2. Hey guys, I have a database of DVDs that I am building a CMS system to handle. I'm currently getting an error with an update statement that is built on the edit portion of the CMS. The table setup is as follow: Column Type Collation Attributes Null Default Extra id int(10) [/td] No None AUTO_INCREMENT title varchar(200) latin1_swedish_ci No year int(5) Yes NULL actors text latin1_swedish_ci Yes NULL genre text latin1_swedish_ci Yes NULL series varchar(200) latin1_swedish_ci Yes false order int(10) Yes 0 img_name varchar(200) latin1_swedish_ci Yes NULL img_location varchar(200) latin1_swedish_ci Yes NULL [td] Here is my statement: UPDATE dvds SET title='American Pie', year='1999', actors='Jason Biggs, Chris Klein, Thomas Ian Nicholas, Eddie Kaye Thomas, Seann William Scott, Alyson Hannigan, Tara Reid, Mena Suvri, Shannon Elizabeth, Natasha Lyonne, Eugene Levy, Molly Cheek, Chris Owen, Jennifer Coolidge, John Cho, James DeBello', genre='teen, comedy', series='American Pie', order='1' WHERE id='13' Here is the error I am seeing: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order='1' WHERE id='13'' at line 1 I have tried redoing the statement removing the quotes from the INT fields. However, still see the same error. I am 100% lost here as I can't see what is wrong at all. I'm sure I am just missing something. Thanks for any help!
  3. Here is what I ended up having to do: var theDate = new Date(); theDate.setTime(createdDate * 1000); var year = theDate.getUTCFullYear(); var month = theDate.getUTCMonth(); var day = theDate.getUTCDate(); var d = months[month] + " " + day + ", " + year; I created an array with the month names in it since getUTCMonth only returns a number. However, it works and gives me the output I need.
  4. That is pretty close, still has the day of the week in there and an abbreviated month. I will play around a bit though. Thanks for the starting point!
  5. Hey guys, I am needing to display the date of when an article was created on my site. I have a UTC string (and this is all I will ever have). So I added this to my page: var d = new Date(); d.setTime(createdDate *1000); Where createdDate is a UTC value like "1266870137". The problem is the out put from that looks somthing like this: Mon Feb 22 2010 15:22:17 GMT-0500 (Eastern Standard Time). I'm hoping to only end up with something like this: February 22, 2010 I would appreciate any help. I've spent quite a while googling and looking at w3schools. I'm just fried at this point. Thanks!
  6. No worries, I figured out a work around by just creating another cookie when the survey plays. Then check for that cookie on each page load. Thanks for all help guys!
  7. Well that was simple enough, but how do I get that to carry over across pages (if it is even possible)? Let me describe the showSurvey() function I have up there. The function hides the main content (display none) of the page, and creates a new div with the survey in it. Once a user clicks the 'submit' button the div with the survey goes away (using .remove) and the div with the main content comes back (display block). This is all done using javascript (jquery and such). Thanks to Crayon, I've tweaked the code so that when showSurvey() fires it places a hash tag in URL saying #survey. So if the user tries to refresh the code sees this hash tag and shows the survey. When they hit submit, I remove the tag from the url. Now, what if a user clicks a different link on the site? The page moves on and they can skip the survey. So my new question is (and I've been googling and can't find a way). How do I carry that #survey tag over whenever a link is clicked? Thanks for all the help so far guys!
  8. Thanks for the links! I was able to figure out the cookie logic I needed. Here are the functions I created/used: function getCookieData(cookieName) { var i,x,y,cookies=document.cookie.split(";"); for (i=0;i<cookies.length;i++) { x=cookies[i].substr(0,cookies[i].indexOf("=")); y=cookies[i].substr(cookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==cookieName){ return unescape(y); } } } function deleteCookie(cookieName) { document.cookie = cookieName + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; } function checkCookies() { var metas = document.getElementsByTagName('meta'); var i; for (i = 0; i < metas.length; i++) { if (metas[i].getAttribute('name') == "pageTitle"){ break; } } var galleryTitle = metas[i].getAttribute('property'); if (document.cookie.indexOf('galleryName') != -1) { var gallery = getCookieData('galleryName'); if(gallery == galleryTitle) { var newValue = getCookieData('galleryViews') * 1 + 1; document.cookie = 'galleryViews=' + newValue; if(newValue/5 == 1) { showSurvey(); document.cookie = 'galleryViews=1'; } } else { showSurvey(); document.cookie = 'galleryName=' + galleryTitle; document.cookie = 'galleryViews=1'; } } else { showSurvey(); document.cookie = 'galleryName=' + galleryTitle; document.cookie = 'galleryViews=1'; } } My new question is this (which maybe I should create a new topic for). How would I temporarily change the document url to include a # pound sign and fictional anchor tag, so users can't refresh away from the survey readily? Thanks for any help!
  9. Hey guys, I have a website that I want to launch a survey popup after a user has cycled through a couple pages. My thought was to insert a cookie when they first hit the site, then increment the cookie by 1 on each page. Then when the cookie hits like 5 or something launch the javascript function I created to display the survey. Here is my problem, I have created the survey function and it works great. However, I don't know how to utilize cookies AT ALL (especially with how I want to use them with the incrementing and launching of function). I would love some help on this. Thanks!
  10. I ended up getting this to work, and the solution was fairly simple. <div id="navbar"> <ul id="nav"> <a href="#" class="hiddenNav">+/-</a> <a href="/" class="first">Home</a></li> <a href="/about">About</a></li> <a href="/archive">Archives</a></li> <a href="/contact">Contact</a></li> <a href="/feed/" class="rss">Subscribe to RSS</a> </ul> </div> <!-- GLOBAL NAV MENU --> <div class="hiddenNav"> <div class="globalNav" style="display:none;"> <script type="text/javascript"> writeTopGlobal_transition(); writeBotGlobal_transition(); </script> </div> </div> <script type="text/javascript"> $(function() { $('.hiddenNav').hover(function() { $('.globalNav').show(); }, function(){ $('.globalNav').delay(3000).hide(); }); }); </script>
  11. After some searching I found it myself; ended up using the waybackmachine. However, I found a couple of tutorials I was looking for.
  12. Hey guys, I am just starting to get into jQuery and I have run into a problem that is annoying the hell out of me. I have a menu with all the main options for the site. However, this site is part of a large network; so I need to include an option for the global nav for the network. The current menu for the site is so: <div id="navbar"> <ul id="nav"> <a href="/" class="first">Home</a></li> <a href="/about">About</a></li> <a href="/archive">Archives</a></li> <a href="/contact">Contact</a></li> <a href="/feed/" class="rss">Subscribe to RSS</a> </ul> </div> I didn't write this page, just going in to add the global nav. Anyway, I modified the menu as such and added the following under it: <div id="navbar"> <ul id="nav"> <a href="#" class="hiddenNav">+/-</a> <a href="/" class="first">Home</a></li> <a href="/about">About</a></li> <a href="/archive">Archives</a></li> <a href="/contact">Contact</a></li> <a href="/feed/" class="rss">Subscribe to RSS</a> </ul> </div> <!-- GLOBAL NAV MENU --> <div class="globalNav" style="display:none;"> <script type="text/javascript"> writeTopGlobal_transition(); writeBotGlobal_transition(); </script> </div> <script type="text/javascript"> $(function() { $('.hiddenNav').hover(function() { $('.globalNav').show(); }); $('.globalNav').hover(function() {}, function() { $('.globalNav').hide() }); }); </script> The two functions in hidden div basically do a document.write of the global nav (which is fairly extensive). Anyway, here is my issue. As you can probably guess with my code I want the global nav to appear when a user hovers over the "+/-" link in the main menu. Then I need it to stay active as long as they are over it. Currently, this works fine. The global nav goes away when they move their mouse off of it. However, during testing I noticed my issue. If you just hover over the "+/-" and never go to the global nav section it stays open. I need it to act much like a drop down in that if the user hovers over the "+/-" the nav shows up and if they move it goes away....unless they move to the nav where it should stay up until they move off of it. Thanks for any help here!
  13. I remember a few years ago there were some other tutorials listed on this site (ie. Creating a Membership system). Is there anyway to still view these tutorials? Or are they lost forever?
  14. I managed it correct this by switching the internal margin to padding. Still not sure why it was happening though. Thanks....
  15. Hey guys, I'm not a front end developer at all. However, I am trying to improve me ability with CSS. I am creating a simple nav menu that is showing up perfectly in IE, but not in FF. Here is the code for the page (nav is obvious I feel): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Welcome!</title> <link rel="stylesheet" href="css/style3.css" type="text/css" media="screen" charset="utf-8" /> </head> <body> <div id="main"> <div id="logo"> <img src="images/logo.png" style="float: left;" /> </div> <div class="clearer"></div> <div id="nav"> <div id="nav_links"> <a href="/">Home</a> | <a href="about.php">About</a> | <a href="contact.php">Contact</a> </div> </div> <div id="content"> <div id="title">Welcome!</div> <p> Content will go here... </p> </div> </div> </body> </html> Here is the style sheet: body { background: #AEAEAE url('/images/background.png'); color: #AEAEAE; font-family: Verdana, Tahoma, Helvetica, Arial; } p { margin: 1px 0px 1px 0px; } a { color: #00001f; text-decoration: none; } a:hover { color: #555555; text-decoration: underline; } #main { margin-left: auto; margin-right: auto; width: 600px; background-color: #ffffff; border: 10px solid #00001f; color: #000000; } #logo { margin: 0px 0px 0px 0px; width: 590px; background-color: #ffffff; } #nav { margin: 5px 0px 5px 0px; height: 50px; background: #ffffff url('/images/navbar.png') no-repeat right top; } #nav_links { margin: 15px 0px 0px 100px; } #content { margin-top: 5px; margin-left: auto; margin-right: auto; width: 590px; height: 300px; background-color: #ffffff; color: #000000; font-size: 14px; overflow: auto; } #title { margin: 1px 0px 1px 0px; color: #00001F; font-weight: bolder; font-size: 18px; } #pageTitle { float: left; } div.clearer { clear: both; } What I am really trying to do is get the "nav_links" to be centered vertically within the "nav" div. I tried margin-top and margin-bottom at both auto, what I have above, and nothing in FF works. It always look great in IE, however in FF is acts as if it is adding the margin to the main "nav" div and not the "nav_links" div. Thanks for any help!
×
×
  • 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.