Professional Web Applications Themes

mysql_fetch_array - MySQL

HI <?php include('conn.php'); mysql_query("insert into reg values ('".$_POST['fname']."','". $_POST['lname']."')"); $result1=mysql_query("select * from reg"); while($row1=mysql_fetch_array($result1)) { echo $row1['firstname']; echo $row1['lastname']; } ?> <?php // 2 statement............... $result=mysql_query("SELECT * FROM reg order by id desc limit 0,1"); while($row=mysql_fetch_array($result)) { ?> <a href="three.php?view=<? echo $row['id']; ?>">View</a> <? } ?> in this above code previously values are inserted after adding 2nd statement the values are not inserted what is problem in my code plz respond..................

  1. #1

    Default mysql_fetch_array

    HI

    <?php
    include('conn.php');
    mysql_query("insert into reg values ('".$_POST['fname']."','".
    $_POST['lname']."')");
    $result1=mysql_query("select * from reg");
    while($row1=mysql_fetch_array($result1)) {
    echo $row1['firstname'];
    echo $row1['lastname'];
    }
    ?>
    <?php // 2 statement...............
    $result=mysql_query("SELECT * FROM reg order by id desc limit 0,1");
    while($row=mysql_fetch_array($result)) {
    ?>
    <a href="three.php?view=<? echo $row['id']; ?>">View</a>
    <? } ?>

    in this above code previously values are inserted after adding 2nd
    statement the values are not inserted what is problem in my code plz
    respond...............

    java.inet@gmail.com Guest

  2. #2

    Default Re: mysql_fetch_array

    == Quote from java.inet (com)'s article 


    can you explain a little more about what you're trying to do and what the problem is?
    --
    POST BY: lark with PHP News Reader
    lark Guest

  3. #3

    Default Re: mysql_fetch_array

    com wrote: 

    What's the result from your insert?

    $result = mysql_query("insert into reg values ('".$_POST['fname']."','".
    $_POST['lname']."')");
    if ($result === false)
    echo mysql_error();

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  4. #4

    Default Re: mysql_fetch_array

    On May 29, 3:58 pm, Jerry Stuckle <net> wrote: 


    >
    > What's the result from your insert?
    >
    > $result = mysql_query("insert into reg values ('".$_POST['fname']."','".
    > $_POST['lname']."')");
    > if ($result === false)
    > echo mysql_error();
    >
    > --
    > ==================
    > Remove the "x" from my email address
    > Jerry Stuckle
    > JDS Computer Training Corp.
    > net
    > ==================[/ref]

    And some punctuation would help.

    strawberry Guest

Similar Threads

  1. mysql_fetch_array():
    By Brandons in forum PHP Development
    Replies: 7
    Last Post: February 4th, 01:43 PM
  2. resetting mysql_fetch_array()
    By jg in forum PHP Development
    Replies: 1
    Last Post: April 5th, 07:19 PM
  3. mysql_fetch_array();
    By Phillip in forum PHP Development
    Replies: 2
    Last Post: February 18th, 10:42 PM
  4. mysql_fetch_array
    By Robert in forum PHP Development
    Replies: 8
    Last Post: January 7th, 08:09 AM
  5. mysql_fetch_array problem
    By Matthew in forum PHP Development
    Replies: 15
    Last Post: January 7th, 01:34 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139