Announcement

Collapse
No announcement yet.

extact variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dimava
    replied
    thanks, thats just what I needed

    Leave a comment:


  • Gramphos
    replied
    Change it to
    extract ($row);

    Leave a comment:


  • Dimava
    replied
    PHP Code:
    $front_page_news=$DB_site->query("SELECT id, name, date, username, description, source, image FROM news ORDER BY date DESC, id DESC LIMIT 5");
    while( 
    $row $DB_site->fetch_array($front_page_news) ) {

    extract ($front_page_news);

    print 
    "$id$name$date$username$description$source$simage";


            
    $newdate2 chunk_split($date2'.');
            
    $newdate substr($newdate20strlen($newdate2)-1);
            
    $description substr($description0500);

        include(
    "templates/index/news_template.php");
            } 
    I get this error:

    Warning: extract() expects first argument to be an array in /home/virtual/site3/fst/var/www/html/test23/index.php on line 24

    line24 is the line that says "extract ($front_page_news);"

    -Dimava

    Leave a comment:


  • MartynJ
    replied
    Your sig doesn't work Mark.

    Leave a comment:


  • Mark Hensler
    replied
    PHP Docs: extract()

    Leave a comment:


  • Dimava
    started a topic extact variables

    extact variables

    PHP Code:
    <?php 
    include("templates/header.htm"); 
    require(
    "admins/config.php");
    require(
    "global.php");
    include(
    "templates/index/index_start.php");

    $front_page_news=$DB_site->query("SELECT id, name, date, username, description, source, image FROM news ORDER BY date DESC, id DESC LIMIT 5");
    while( 
    $row $DB_site->fetch_array($front_page_news) ) {

            
    $newdate2 chunk_split($date2'.');
            
    $newdate substr($newdate20strlen($newdate2)-1);
            
    $description substr($description0500);

        include(
    "templates/index/news_template.php");
            }

    include(
    "templates/index/index_end.php");
    include(
    "templates/footer.htm"); 
    ?>
    How Do I extract the variables within the loop

    thanks

    Dimava

Related Topics

Collapse

Working...
X