Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,449 members, 7,816,042 topics. Date: Friday, 03 May 2024 at 12:40 AM

Php Dev Help - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Php Dev Help (592 Views)

Php Dev Needed For A Simple Task / Intern Or Junior Dev. Job / I Need A Dev For Small Work (2) (3) (4)

(1) (Reply) (Go Down)

Php Dev Help by 3exe3: 2:40am On Feb 03, 2022
grin cant just find whats wrong with my insert statement

checked the types on my db and made sure its in the right order but no way out

its in the screenshot below

working with dynamic data which i looped through and escaped before inserting

pls help

Re: Php Dev Help by youngpresidooo: 3:27am On Feb 03, 2022
3exe3:
grin cant just find whats wrong with my insert statement

checked the types on my db and made sure its in the right order but no way out

its in the screenshot below

working with dynamic data which i looped through and escaped before inserting

pls help
it is your mysql version
Re: Php Dev Help by fnep2smooth(m): 6:50am On Feb 03, 2022
3exe3:
grin cant just find whats wrong with my insert statement

checked the types on my db and made sure its in the right order but no way out

its in the screenshot below

working with dynamic data which i looped through and escaped before inserting

pls help
Let the the screenshot of the insert code
Re: Php Dev Help by 3exe3: 9:07am On Feb 03, 2022
youngpresidooo:
it is your mysql version
Thanks will try changing the version
Re: Php Dev Help by efelico: 1:34pm On Feb 03, 2022
ensure that all string values are quoted and integer values are not quoted
Re: Php Dev Help by qtguru(m): 4:23pm On Feb 03, 2022
youngpresidooo:
it is your mysql version

That is wrong
Re: Php Dev Help by qtguru(m): 4:24pm On Feb 03, 2022
Ensure the values are quoted

1 Like

Re: Php Dev Help by stanliwise(m): 9:08am On Feb 05, 2022
3exe3:
grin cant just find whats wrong with my insert statement

checked the types on my db and made sure its in the right order but no way out

its in the screenshot below

working with dynamic data which i looped through and escaped before inserting

pls help
Are we magicians, paste the full SQL queries,
Hian. na wa for person wey look for solution o

1 Like

Re: Php Dev Help by richebony: 10:45am On Feb 05, 2022
It's obviously a syntactic error...paste the statement here so we can debug. .can't remember the last time I used native queries sef. .except short ones though ..most ORM/ODM abstracts them
Re: Php Dev Help by 3exe3: 3:24pm On Feb 05, 2022
qtguru:
Ensure the values are quoted


private function getData($data)
{
foreach($data as $row => $value)
{
$this->rows[] = $this->escape($row);
$this->values[] = $this->escape($value);
}
}


protected function insert($table, $data)
{
$this->getData($data);
$sql = 'INSERT INTO '.$table.'('.implode(',', $this->rows).') VALUES ('.implode(',', $this->values).')';
if(!$this->query($sql))
{
return $this->error();
}
return $sql;
}



if(REQUEST_METHOD === 'POST')
{
$data = array(
'firstname' => (string)$_POST['firstname'],
'lastname' => (string)$_POST['lastname'],
'username' => (string)$_POST['username'],
'password' => (string)sha1($_POST['password']),
'email' => (string)$_POST['email'],
'gender' => (string)$_POST['gender'],
'phonenumber' => (string)$_POST['phonenumber'],
'address' => USER_LOCATION,
'date_joined' => date(DateTime::RFC2822),
'user_level' => 'user',
'is_verified' => 0
);
}
Re: Php Dev Help by 3exe3: 4:21pm On Feb 05, 2022
solved it

with

'\''.$this->escape($value).'\''
Re: Php Dev Help by qtguru(m): 6:48am On Feb 06, 2022
3exe3:
solved it

with

'\''.$this->escape($value).'\''

Use PDO my brother, I get it is a lot of code but it pays off in the long run. is this company work or personal project ? if personal project then continue
Re: Php Dev Help by 3exe3: 6:52am On Feb 06, 2022
qtguru:


Use PDO my brother, I get it is a lot of code but it pays off in the long run. is this company work or personal project ? if personal project then continue

Personal

Why u asking
Re: Php Dev Help by qtguru(m): 6:59am On Feb 06, 2022
3exe3:


Personal

Why u asking

I was looking at Database Support, PDO will allow your port your code to any DB, and using Prepared statements is much safer, for real life projects you can't use this type of code. that's why I asked
Re: Php Dev Help by qtguru(m): 7:52am On Feb 06, 2022
3exe3:


Personal

Why u asking

Also A Company is looking for a PHP Developer, OOP Knowledge is mostly required, let me know later

1 Like

Re: Php Dev Help by 3exe3: 2:29pm On Feb 06, 2022
qtguru:


Also A Company is looking for a PHP Developer, OOP Knowledge is mostly required, let me know later

in prophet isaiah voice 'Here I am send me".

I got what it takes thats what I mean by the way.

What do I need to do.
Re: Php Dev Help by qtguru(m): 2:30pm On Feb 06, 2022
3exe3:


in prophet isaiah voice 'Here I am send me".

I got what it takes thats what I mean by the way.

What do I need to do.

send email to okeowo.aderemi@yandex.com so I can explain. Thanks
Re: Php Dev Help by 3exe3: 2:47pm On Feb 06, 2022
qtguru:


send email to okeowo.aderemi@yandex.com so I can explain. Thanks

sent it now as woyenghilabofa@outlook.com

(1) (Reply)

Telemedicine App Development / Python With MYSQL: Registration Form In Python Using Tkinter And MYSQL Database / Searching For Frontend Development Internship

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 25
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.