[Solved] Getting data into MySQL table easier.
#3

I got it solved... i made a loop and used an array:

pawn Код:
new Float:Veh[590][4] =
{
  {x,y,z,a},
  .
  .
  .
};
pawn Код:
CMD:saveee(playerid, params[])
{
  #pragma unused params
  new
    query[];

  for(new i = 0; i < 591; i ++)
  {
    format(query, sizeof(query), "UPDATE `table` SET x='%.4f', y='%.4f', z='%.4f', a='%.4f' WHERE ID='%d'", Veh[i][0], Veh[i][1], Veh[i][2], Veh[i][3], i);
    mysql_query(query);
    printf("%d", i); // this was important
  }
  return 1;
}
Thanks!
Reply


Messages In This Thread
[Solved] Getting data into MySQL table easier. - by Miguel - 23.01.2010, 21:50
Re: Getting data into MySQL table easier. - by Chaprnks - 24.01.2010, 00:53
Re: Getting data into MySQL table easier. - by Miguel - 24.01.2010, 01:15

Forum Jump:


Users browsing this thread: 1 Guest(s)