Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tep equivalent to mysql_fetch_row($result)???


Snowman

Recommended Posts

Whats the osCommerce tep function equivalent to mysql_fetch_row($result);

 

I have a form in a mod that im working on that posts to a table and an id is assigned to each posting, however i want to echo that id on a success page....

 

the script im working from has:

  $query = "SELECT id FROM problems WHERE name = '$name' AND problem = '$problem';";

 $result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error());

 list($ticketno) = mysql_fetch_row($result);

 

and i have so far changed it to:

 

  $query = "SELECT id FROM problems WHERE name = '$name' AND problem = '$problem';";

 $result = tep_db_query($query);

 list($ticketno) = tep_fetch_row($result);

 

everything works except the last line:

 

  list($ticketno) = tep_fetch_row($result);

 

what do i need to change this line to???

Link to comment
Share on other sites

what do i need to change this line to???

 

I would use

 

list($ticketno) = tep_db_fetch_array($result);

 

As there is no wrapper for mysql_fetch_row

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

hmm thats what i thought but i couldnt get it to work properly...oh well ill adjust things to suit

 

If not add this to includes/functions/database.php

 

  function tep_db_fetch_row($db_query) {

   return mysql_fetch_row($db_query);

 }

 

Then you can replace tep_db_fetch_array with tep_db_fetch_row :)

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...