This is a discussion on mysql_fetch_array within the MySQL Database forums, part of the Database Forums category; HI <?php include('conn.php'); mysql_query("insert into reg values ('".$_POST['fname']."','". $_POST['lname']."')&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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............... |
|
|||
|
== Quote from java.inet (java.inet@gmail.com)'s article
> 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............... 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 |
|
|||
|
java.inet@gmail.com wrote:
> 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............... > 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. jstucklex@attglobal.net ================== |
|
|||
|
On May 29, 3:58 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> java.i...@gmail.com wrote: > > 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............... > > 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. > jstuck...@attglobal.net > ================== And some punctuation would help. |