#28 Signup errors | Simple point of sale app in php & javascript | Quick programming tutorial

preview_player
Показать описание
Lets build a simple point of sale website application from scratch using php desktop. we will use sqlite data storage, javascript and some bootstrap css.

complete playlist:

source code:

more tutorials:
make a social website from scratch:

all crash courses:

code a live chat app in PHP and JavaScript:

make an eCommerce website from template:

convert an HTML template to PHP website:

simple signup and login system & security:

crop images with PHP:

PHP Object Oriented Programming basics:

Chart or graph using SVG:

Responsive web design:

clean pretty URLs:

support me on patreon:

my facebook:
Рекомендации по теме
Комментарии
Автор

I have these errors can you help me Eathorne ?

Warning: Undefined variable $table in on line 33

Warning: Undefined property: User::$ in on line 33

Fatal error: Uncaught Error: Object of class User could not be converted to string in Stack trace: #0 Model->insert(Array, 'users') #1 #2 {main} thrown in on line 36


<?php

/**
* model class
*/
class Model extends Database
{

protected $allowed_columns = [];

protected function get_allowed_columns($data)
{



foreach ($data as $key => $value) {

if(!in_array($key, $this->get_allowed_columns))
{

}

}
}

return $data;

}

public function insert ($data)
{

$clean_array = $this->get_allowed_columns ($data, $this->$table);
$keys = array_keys($clean_array);

$query = "insert into $this->$table ";
$query .= "(".implode(", ", $keys) .") values ";
$query .= "(:".implode(", :", $keys) .")";

$db = new Database;
$db->query($query, $clean_array);

}

/* public function insert($data, $table)
{
$clean_array =
$keys = array_keys($clean_array);

$query = "INSERT INTO $table ";
$query .= "(" . implode(", ", $keys) . ") VALUES ";
$query .= "(:" . implode(", :", $keys) . ")";

$db = new Database;
$db->query($query, $clean_array);
}
*/


public function where($data)
{
$keys = array_keys($data);
$conditions = [];

foreach ($keys as $key) {
$conditions[] = "$key = :$key";
}

$conditionString = implode(' AND ', $conditions);
$query = "SELECT * FROM $this->table WHERE $conditionString";

$db = new Database;
return $db->query($query, $data);
}

}

kaizendom
join shbcf.ru