mysql auto_increment

mysql auto_increment

am 07.09.2008 23:16:29 von Chris Hale

I am writing a catologe application and i have a problem when it comes
to the edit product part. I have a table with the catogories and a table
with manufacturers.
Each table has a id column and a name column. The id column is set up in
the MySQL to auto_increment, which works fine normally, but i am writing
this script:

function edit_cat_radio($item_cat_id)
{
connect();
$sql = "SELECT * FROM cat DISTINGT ORDER BY cat_id";
$result = mysql_query($sql);
$k = 1;
while ($row = mysql_fetch_assoc($result))
{
extract($row);
echo '

Re: mysql auto_increment

am 07.09.2008 23:46:29 von Evert Lammerts

I guess this code was not copy pasted from your actual source? It
would generate mysql errors.

Anyway, I think I've an idea of what you want, so here's my two cents :

function edit_cat_radio($item_cat_id) {
connect();
$query = mysql_query("SELECT * FROM cat");
while ($row = mysql_fetch_assoc($query)) {
echo "

Re: mysql auto_increment

am 07.09.2008 23:49:26 von Evert Lammerts

Pastebin is so much nicer when posting code. Find the code i've sent here:

http://pastebin.com/mc5d611a

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: mysql auto_increment

am 07.09.2008 23:52:33 von Evert Lammerts

Little change - the label was not used in the right way:

http://pastebin.com/m2d98e677

On Sun, Sep 7, 2008 at 11:46 PM, Evert Lammerts
wrote:
> I guess this code was not copy pasted from your actual source? It
> would generate mysql errors.
>
> Anyway, I think I've an idea of what you want, so here's my two cents :
>
> function edit_cat_radio($item_cat_id) {
> connect();
> $query = mysql_query("SELECT * FROM cat");
> while ($row = mysql_fetch_assoc($query)) {
> echo "