This topic is locked

Event Code

1/7/2009 3:45:38 PM
PHPRunner General questions
A
Aleix author

Hello and thanks in advance;
I write this code that works fine out of PHPRunner, but when I insert in PHPRunner we have problem with WHILE sentence
Can you help me? I don´t Know what´s happen!
// Read de data

$rs = db_query("select * from " .$tablaDestino, $conn );
if($data=db_fetcharray($rs))

{

$camposDestino ="(";

echo($camposDestino ."
");

// Select de name o fields

$i=1
//SENTECES WITH PROBLEMS!!!____


while ( $i < mysql_num_fields($rs))

{

$camposDestino .= mysql_field_name($rs, $i) .", ";

$i = $i + 1;

}
//-----------------------------------------------------------------------------
echo($camposDestino ."
");
'Thanks

J
Jane 1/8/2009

Hi,
please see my changes below:

// Read de data

$rs = db_query("select * from " .$tablaDestino, $conn );
if($data=db_fetch_array($rs))

{

$camposDestino ="(";

echo($camposDestino ."
");

// Select de name o fields

$i=1;
while ( $i < mysql_num_fields($rs))

{

$camposDestino .= mysql_field_name($rs, $i) .", ";

$i = $i + 1;

}
echo($camposDestino ."
");

}

A
Aleix author 1/8/2009

Hi,

please see my changes below:


Hi Jane;
Sorry, but I can not see the changes that you have done.
Thanks

J
Jane 1/8/2009

Hi,
you've missed some semicolon and } in your code.

A
Aleix author 1/8/2009

Hi,

you've missed some semicolon and } in your code.


Thanks Jane, I have forgotten the semicolon!
But in another hand, then It is possible use the mysql_num_fields() and mysql_field_name() directty in code events?
I have undertood that it not was possible, that I use only the funtions PHP
Many Thanks

J
Jane 1/9/2009

Hi,
you can use mysql_num_fields() and mysql_field_name() functions in your event code.

A
Aleix author 1/9/2009

Hi,

you can use mysql_num_fields() and mysql_field_name() functions in your event code.


Thanks Jane