This topic is locked

AddOnLoad

10/24/2006 9:54:29 AM
PHPRunner General questions
D
dieter author

In Version 3.0 I used the following code and it worked fine to give me the next number when i load the form:
<?php
function AddOnLoad(&$values)

{

//** Custom code ****

// put your custom code here

global $conn, $strTableName;

$rs = db_query("select count(tgbNr) from _posteingang " , $conn);

$data = db_fetch_numarray($rs);

$Anzahl = $data[0];

$values["tgbNr"]=$Anzahl +1;

}
?>
Now I get the Error Missing Argument 1 for addonload ().
Fehlerdatei: ......../***events.php
Whats wrong now ?
Thank you
Dieter

J
Jane 10/24/2006

Hi,
here is the correct code for the PHPRunner 3.1:

function AddOnLoad()

{

//** Custom code ****

// put your custom code here

global $conn, $strTableName;

$rs = db_query("select count(tgbNr) from _posteingang" , $conn);

$data = db_fetch_numarray($rs);

$Anzahl = $data[0];

$_SESSION["tgbNr"]=$Anzahl+1;

}



And then use $_SESSION["tgbNr"] as default value on the "Edit as" settings dialog on the Visual Editor tab.

D
dieter author 10/24/2006

Hi,

here is the correct code for the PHPRunner 3.1:
And then use $_SESSION["tgbNr"] as default value on the "Edit as" settings dialog on the Visual Editor tab.


Now I get another Error:
Array to String conversion ??

Alexey admin 10/24/2006

Dieter,
the code looks correct.

Please show me the full error message.

D
dieter author 10/25/2006

Dieter,

the code looks correct.

Please show me the full error message.


The complete Error is:
PHP … Fehler ist aufgetreten
Technische Information

Fehlertyp 8

Fehlerbeschreibung Array to string conversion

URL www......de/tagebuch1/_posteingang_add.php?

Fehlerdatei /srv/www/htdocs/tagebuch1/_posteingang_add.php

Fehlerzeile 205

SQL Abfrage
And in Line 205 of _posteingang_add.php is:
$defvalues["tgbNr"]=$_SESSION["tgbNr"];
best regards

Dieter

D
dieter author 10/25/2006



The complete Error is:
PHP ... Fehler ist aufgetreten
Technische Information

Fehlertyp 8

Fehlerbeschreibung Array to string conversion

URL www......de/tagebuch1/_posteingang_add.php?

Fehlerdatei /srv/www/htdocs/tagebuch1/_posteingang_add.php

Fehlerzeile 205

SQL Abfrage
And in Line 205 of _posteingang_add.php is:
$defvalues["tgbNr"]=$_SESSION["tgbNr"];
best regards

Dieter


Sorry, my fault <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=12133&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />
it was a missing [
thanks Dieter