Default value when add row.

QuestionsDefault value when add row.
Jorge Barosa asked 3 years ago

I'm trying to add default value of the user when saving the form with no sucess !!

The query:
mysql_select_db ( $database_ggi, $ggi );
$query_rsUserName = sprintf ( "SELECT nome FROM utilizadores WHERE utilizador = '%s'", $_SESSION['MM_Username'] );
$rsUserName = mysql_query ( $query_rsUserName, $ggi ) or die ( mysql_error () );
$row_rsUserName = mysql_fetch_assoc ( $rsUserName );
$totalRows_rsUserName = mysql_num_rows ( $rsUserName );

$nome = $row_rsUserName['nome'];

$e["on_insert"] = array("add_client", null, true);

function add_client(&$data)
$data["params"]["Utilizador"] = $nome;

Can somewone help me!

Best regards,
Jorge Barosa

1 Answers
Abu Ghufran answered 3 years ago

You need to define it as global.

function add_client(&$data)
global $nome;
$data["params"]["Utilizador"] = $nome;

Your Answer

19 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!