Jump to content

falkencreative

Advanced Member
  • Posts

    4,419
  • Joined

  • Last visited

  • Days Won

    27

Posts posted by falkencreative

  1. Then I would look at the "live" issue -- apparently in the latest version of jQuery, that functionality has been depreciated and they intend you to use "on" instead (check the jquery documentation). You can either switch to use "on" rather than "live" (check the documentation), or you'll need to load a version of jquery earlier than the current 1.7 version.

     

    I'm not sure what the colorbox error is, and a quick search isn't turning much up, but try fixing the other two errors first and perhaps that one will resolve itself.

  2. Just removing or fixing that code won't necessarily be enough to fix things. That's just something I noticed -- not a significant error that the Console was complaining about. Next up would be to fix the "live" issue as I talked about.

     

    The error is talking specifically about:

     

    $('#fp_cancel').live('click', function(e){

    e.preventDefault();

    $.colorbox.close();

    });

  3. When I look at the console, I see these two errors:

     

    -- Uncaught TypeError: Cannot read property 'msie' of undefined colorbox.js:4 (colorbox.js)

    -- Uncaught TypeError: Object [object Object] has no method 'live'

     

    I also see that you have used jQuery's NoConflict functionality, but there is code at the bottom of the page that doesn't properly follow jQuery's NoConflict rules:

     

    <script type="text/javascript">

    var currentYear = (new Date).getFullYear();

    $(document).ready(function() {

    $("#year").text( (new Date).getFullYear() );

    });

    </script>

     

    Personally, I would start by fixing the above code. Then I would look at the "live" issue -- apparently in the latest version of jQuery, that functionality has been depreciated and they intend you to use "on" instead (check the jquery documentation). You can either switch to use "on" rather than "live" (check the documentation), or you'll need to load a version of jquery earlier than the current 1.7 version.

     

    I'm not sure what the colorbox error is, and a quick search isn't turning much up, but try fixing the other two errors first and perhaps that one will resolve itself.

  4. I really don't think there is going to be a magic tool for that -- each frame of that animation would very likely be hand drawn. To some extent you can use the free transform tool to adjust the proportions of large elements (like a wing), but this is more of an illustration question than something done by a photoshop tool.

  5. I think rather than replacing what is in var x ="My"; --> It just grabs the last item that looped through the .each function which was the

    Irish Span (would i be right here?)

    Correct.

     

    By the way, do you know what happens to the stuff on fiddlejs -- is it left there forever?

    Do you use fiddlejs for this type of question/example?

    I can't really comment on this -- it isn't something I use. You might want to check the FiddleJS support or FAQs or something. Though I don't use it much, it is useful for questions where the code needs to run, and means it's a bit easier for me to help you with any questions without having to manually create my own files and copy/paste code.

  6. Here's a simple example. Say you have this:

     

    x = 1;

    x += 2;

     

    The result of x should be "3". The += adds whatever is on the right side of the "+=" to whatever is on the left. It's the same as saying:

     

    x = 1;

    x = x + 2;

     

    In your sample, when you click the button, you use jQuery to get the value of each .span, adding it to "x" each time. The alert message that appears after the loop completes displays the values for all .spans in the page.

     

    The first time it loops, it grabs the value for the first .span: "Nationality: " and adds it to the x variable. The second time it loops, it gets the second value " Irish", and adds that to x. Once the loop completes and there are no more .spans to access, Javascript uses an alert message to display the final value for x.

     

    Hope that helps?

    • Upvote 1
  7. So when you run the first file, you get "We have no products listed in Our store Yet"?

     

    In the second file, here's the PHP code at the start, a bit more organized:

     

    ?php
    // Check to see URL Variable is set and that it exists in the database
    if (isset($_GET['id']))
    {
    
    $id = preg_replace('#[^0-9]#i', '', $_GET['id']);
    
    //use this var to check to see if this ID Exists, if yes then get the product
    //details, if no then exit this script and give message why.
    $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
    $productCount = mysql_num_rows($sql);//count the the output ammount 
    
    if ($productCount > 0)
    { 
    	// get all the product details
    	while($row = mysql_fetch_array($sql))
    	{ 
    		$product_name = $row["product_name"];
    		$price = $row["price"]; 
    		$details = $row["details"]; 
    		$category = $row["category"]; 
    		$subcategory = $row["subcategory"]; 
    		$date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); // Notice here how we changed it from _added to _Added 
    		//product_name,price,details,category,subcategory,date_added
    	}
    }
    else
    {
            echo "That item does not exist.";
            exit();
    }
    }
    else
    {
    echo "No product in the database with that ID";
    exit();
    } 
    
    mysql_close();
    
    ?>

     

    If you are getting the "No product in the database with that ID", according to your code, that means that you don't have an ID set in the url, like "products.php?id=1". You need to have an id set in order to use this page.

  8. That's because your inputs aren't named properly:

     

    <strong>Years: *</strong> <input type="text" name="cwyears" value="<?php echo $cwyears; ?>"/><br/>

    <strong>Coach Name: *</strong> <input type="text" name="cwname" value="<?php echo $cwname; ?>"/><br/>

    <strong>Wins: *</strong> <input type="text" name="cwname" value="<?php echo $cwwins; ?>"/><br/>

    <strong>Losses: *</strong> <input type="text" name="cwname" value="<?php echo $cwlosses; ?>"/><br/>

    <strong>Ties: *</strong> <input type="text" name="cwname" value="<?php echo $cwties; ?>"/><br/>

    <strong>Percent: *</strong> <input type="text" name="cwname" value="<?php echo $cwpercent; ?>"/><br/>

     

    Note how they are all named "cwname"?

     

    For example, to use $_POST['cwpercent'], you need to have an input named "cwpercent".

  9. You'll need to do a little testing, but I would bet this line:

     

    var height = $(this).outerHeight();

     

    is returning 0 for elements within slides that aren't visible, since those slides are set to display: none when the page first loads and that script runs. jQuery can't figure out the proper height without the element being visible in the page.

     

    I don't really have a solution for you, though you might check http://stackoverflow.com/questions/2345784/jquery-get-height-of-hidden-element-in-jquery or see what workarounds others have done for this issue. Alternatively, you could rewrite the slideshow or use a different slideshow script that doesn't hide slides by using display:none, but perhaps hides them using z-index or by moving them out of sight.

  10. Just realized -- this is incorrect:

     

    $id = $_GET['cwid'];

    $result = mysql_query("SELECT * FROM coachwin WHERE cwid=$cwid")

     

    You never create an $cwid variable, meaning you get an incorrect query where "cwid" doesn't equal anything. Change it to:

     

    $cwid = $_GET['cwid'];

    $result = mysql_query("SELECT * FROM coachwin WHERE cwid=$cwid")

     

    and hopefully the issue will go away. You might have the same issue on the delete page -- make sure you are setting the variables used in the mysql query.

  11. Actually, a quick follow up... I just realized you have two SQL queries in your code -- one to select an element from the database, and one to update that element in the database. When are you getting this error? When you first load the page? Or when you enter information and submit the form?

     

    Again, I'm not really seeing anything incorrect with either query, so my guess would be a misspelling or typo in a column name. Maybe when you made the table originally, you named misspelled "cwwins" (maybe "cwins" instead) due to the double "w"s?

  12. Sometimes the error that displays in the browser isn't super helpful, so I'd suggest doing this...

     

    Just before this line in your code:

     

     mysql_query("UPDATE coachwin SET cwyears='$cwyears', cwname='$cwname', cwwins='$cwwins', cwlosses='$cwlosses', cwties='$cwties', cwpercent='$cwpercent' WHERE cwid='$cwid'")
    or die(mysql_error()); 

    add the lines:

     

    echo "UPDATE coachwin SET cwyears='$cwyears', cwname='$cwname', cwwins='$cwwins', cwlosses='$cwlosses', cwties='$cwties', cwpercent='$cwpercent' WHERE cwid='$cwid'";
    exit;

    Test the code, and act like you are trying to update a record. Instead of updating, the browser should show you the query you are trying to use, then exit. Copy that query, then open up PHPMyAdmin and select your database. Next, select the "SQL" tab, and paste in your large text box. Click the "Go" button to run the query. You should get an error message, but hopefully a more specific error than the one you are currently seeing. Use that error to debug the query. (or, if you are still having trouble, paste what PHPMyAdmin tells you here, and I'll see if there is anything I can do).

     

    Personally, I'm not seeing anything that immediately stands out to me as questionable, though I'm obviously missing something if you are getting an error message. You might double check that all your column names match (perhaps you mis-named something when creating the database?), and keep in mind that column names are case sensitive.

×
×
  • Create New...