Cannot access offset of type string on string... WTF ?
ephelya
Posted messages
296
Status
Membre
-
ephelya Posted messages 296 Status Membre -
ephelya Posted messages 296 Status Membre -
Hello,
I have a PHP function (called via AJAX) that sends me this error message (Cannot access offset of type string on string) and I absolutely don't understand where it's coming from... Help!
Here’s the call to my function
And here’s my function
It tells me
And line 55 is this line
From what I understand, there’s a story about attempting to access an index of an array or something, but the value $idplace is 2151300759, so a plain integer... What am I missing????
Thank you in advance for your help, this is urgent for me...
Configuration: Macintosh / Firefox 99.0
I have a PHP function (called via AJAX) that sends me this error message (Cannot access offset of type string on string) and I absolutely don't understand where it's coming from... Help!
Here’s the call to my function
if ($flwprosp) { $result = flwprosp($flwprosp, $civilite, $iduser, $nrp, $tel, $mail, $nom, $prenom, $adresse, $cpostal,$ville, $where, $date, $comment, $nextact, $noway, $debug); } </code Here’s the data received <code php> Array ( [flwprosp] => 2151300759 [nrp] => 1 [civilite] => Mme [iduser] => baa9188a-0dd0-4f50-aaab-65e421cca195 [tel] => tel [mail] => mail [nom] => nom [prenom] => prenom [adresse] => address [cpostal] => 00000 [ville] => ville [where] => splae [date] => 23/06/12:00 [comment] => eer [nextact] => 5 [noway] => 1 [debug] => 1 ) And here’s my function
function flwprosp($idplace, $civilite, $iduser, $nrp, $tel, $mail, $nom, $prenom, $adresse, $cpostal,$ville, $where, $date, $comment, $nextact, $noway, $debug) { echo " flwprosp($idplace, $civilite, $iduser, $nrp, $tel, $mail, $nom, $prenom, $adresse, $cpostal,$ville, $where, $date, $comment, $nextact, $noway, $debug)"; if ($noway==1) { $client['statut'] = 4; } if ($nrp==1) { $client['statut'] = 3; } else { $client['statut'] = 2; } if ($nrp = 1) { $nextact = 7; } //we update the property $table = "Annonces"; $where["idlbc"] = $idplace; $place["adresse"] = $adresse; $place["cpostal"] = $cpostal; $place["ville"] = $ville; \Models\Admin::update($place, $table, $where, "", $debug); } It tells me
flwprosp(2151300759, Mme, baa9188a-0dd0-4f50-aaab-65e421cca195, 1, tel, mail, nom, prenom, address, 00000,ville, splae, 23/06/12:00, eer, 5, 1, 1)
<br />
"Fatal error</b>: Uncaught TypeError: Cannot access offset of type string on string in /homepages/41/d736140878/htdocs/escalierb/admin/www/ajx/ajax.php:55"
And line 55 is this line
$where["idlbc"] = $idplace;
From what I understand, there’s a story about attempting to access an index of an array or something, but the value $idplace is 2151300759, so a plain integer... What am I missing????
Thank you in advance for your help, this is urgent for me...
Configuration: Macintosh / Firefox 99.0
4 réponses
yg_be
Posted messages
23437
Registration date
Status
Contributeur
Last intervention
Ambassadeur
1 587
Hello, the starting point would be to share your complete code.
Please indicate the name of each file you share.
What did you assign to
Did you write this code?
Are you testing it for the first time?
Please indicate the name of each file you share.
What did you assign to
$wherebefore calling the function?
Did you write this code?
Are you testing it for the first time?
What is this ?
Have you tried translating the error message?
For me, it says "Cannot access an offset of type string on a string".
This indicates that it is not allowed to use a string type index ("idlbc") on a string ($where).
Isn't that clear?