Welcome Guest, Not a member yet? Register   Sign In
"message": "Uninitialized string offset: 0"
#11

(08-30-2020, 07:54 AM)jreklund Wrote: Have you tried this?

PHP Code:
$pQuery->execute("slug","url","title","abstract","authors","areas",
"keywords","journalName","volume","issue","pageNumber","indexing",
"publishDate","creatingAuthor","ip","pdfTitle","pdfFileName",nullnull); 
Yes Null also no error its working fine only problem with empty string.

if I entered any field empty then error i tried named prepared statement also giving same error.

Is my prepared statement is correct?
Reply
#12

(This post was last modified: 08-30-2020, 08:31 AM by jreklund.)

The docs dosen't state that it won't accept empty strings, but I can't see something obvious in the the source code that removes it. You will have to follow the trace from Query:479 and work your way up to see where it gets deleted.

If you cant solve it yourself, open an issue; https://github.com/codeigniter4/CodeIgniter4/issues
Reply
#13

(08-30-2020, 08:30 AM)jreklund Wrote: The docs dosen't state that it won't accept empty strings, but I can't see something obvious in the the source code that removes it. You will have to follow the trace from Query:479 and work your way up to see where it gets deleted.

If you cant solve it yourself, open an issue; https://github.com/codeigniter4/CodeIgniter4/issues


Hi thank you for your support.

i seen the error coming from file system/DataBase/Query.php line number 479

in real source file i have this line as

$escapedValue = $binds[$c][1] ? $this->db->escape($binds[$c][0]) : $binds[$c][0];


with this line i am getting error like uninitialized string at offset at 1  for the same prepare statement



so i changed into 

$escapedValue = isset($binds[$c][1]) ? $this->db->escape($binds[$c][1]) : $binds[$c][0];

with this change i got error like uninitialized string at offset at 0  for the same prepare statement

later i found the error i am getting is only if i try to empty string so i changed my field to accept null even though same error 

as you said i will raise issue in codeignitor 
thank you for your continuous support.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB