Reply to Re: Handling data returned by mysql_fetch_row()

Your name:

Reply:


Posted by Michael Phipps on 08/04/05 03:47

> $result = mysql_query ($sql);
> $row = mysql_fetch_row($result);
> while($row = mysql_fetch_array($result , MYSQL_NUM))
> {
> echo "
> <table width=100% border=1 height=18 bgcolor=#DADADA
> onmouseover=this.style.backgroundColor='#ffcc99';
> onmouseout=this.style.backgroundColor='#DADADA';>
> <tr>
> <td width=300> $row[0] </td>
> <td width=100> $row[1] </td>
> </tr>
> </table>
> ";}
>
> Now what whould I add here to make it work like in PHPMyAdmin?
> Any help appreciated!
>

You are wanting to edit/update an individual row? Well you need something
to uniquely identify that row. Most commonly, an id field in your database
that autoincrements. Because the ID field is unique you can use a select /
update query to do something to it: ie: SELECT * FROM table WHERE id=4;

BTW - to make your code easier to read, consider using mysql_fetch_assoc.
Info on this at http://au3.php.net/mysql_fetch_assoc - there are also a few
examples there to help you understand the function.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация