Bluehost.com Web Hosting $6.95

mysql_fetch_array

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']."')&...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-29-2007
java.inet@gmail.com
 
Posts: n/a
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...............

Reply With Quote
  #2 (permalink)  
Old 05-29-2007
lark
 
Posts: n/a
Default Re: mysql_fetch_array

== 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
Reply With Quote
  #3 (permalink)  
Old 05-29-2007
Jerry Stuckle
 
Posts: n/a
Default Re: mysql_fetch_array

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
==================
Reply With Quote
  #4 (permalink)  
Old 05-29-2007
strawberry
 
Posts: n/a
Default Re: mysql_fetch_array

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.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0