Results 1 to 3 of 3

Thread: PHP with MySQL problem

  1. #1
    Join Date
    Mar 2005
    Posts
    2

    PHP with MySQL problem

    ok, so i've got a site im integrating with a MySQL database.

    on the index page i have a table with space for a date and text and whatnot, but right now, my current code will not get the text from the database. here is what i have:

    PHP Code:
    <body>
    <?php include ("secure/mysqlsubs.inc");
    connect_to_cms(); ?>

    thats to start the body. and below that is a mess of tables that looks good when you view it smile.gif

    and then in this specific table:

    PHP Code:
    <div class="cboxes">
    <h4>
    <?php
    $find 
    mysql_query("select * from News");
    $f=mysql_fetch_array($find);
    $NewsDate=$f["NewsDate"];
    echo 
    "$NewsDate ";
    ?>
    </h4>

    i know the code is right, but nothing is getting output!

    if anyone knows PHP/MySQL/HTML better than i seem to, i can let you look at the full source if you want. i just cant figure this out!

  2. #2
    Join Date
    Feb 2003
    Posts
    1,048
    Let me preface my comments by saying that I'm not a PHP/MySQL developer.

    Is there data in the table and field?

    Try changing this line:

    echo "$NewsDate ";

    To this:

    echo $NewsDate;


    Otherwise, try reading through this: http://us3.php.net/manual/en/functio...etch-array.php

  3. #3
    Join Date
    Mar 2005
    Posts
    2
    nope that wasnt it. it was becuase at first i had made it all html and had the <?xml tags at the top with some xml stuff, i guess that confused it. i took those out and it worked fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •