How to Create a Blog PHP & MySQL database #20 | Create, Read, Update topics

How to Create a Blog PHP & MySQL database #20 | Create, Read, Update topics

Awa Melvine

4 года назад

10,930 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Anari Shakari
Anari Shakari - 12.03.2023 01:01

Amazing. Waoo... I am getting practical.

Ответить
TELMAC Solutions
TELMAC Solutions - 19.01.2023 09:26

how did anyone bind the id (which is of type int) to the update query function in the admin folder and have it retrieve results?

Ответить
TELMAC Solutions
TELMAC Solutions - 18.01.2023 16:27

hi all, anyone following this in 2023? found this error: Uncaught Error: Call to a member function bind_param() on bool in H:\xampp\htdocs\blog\App\database\db.php:22 for admin create posts but signup in root folder working well. checked table name, sql query, nothing seems to be the issue

Ответить
Prince Kartey Otumfuo
Prince Kartey Otumfuo - 03.09.2022 14:55

Hello Sir, please in the statement to get the id from the browser, in the case of $id=topic["id"]; $name=topic ["name"]... I have an error which says "undefined index: id and same applies to the name and description" ... I realized it's because of the topic["id"] for instance that we assigned to the $id..

Please how may I address this error?

Ответить
Abdirauf Abdi
Abdirauf Abdi - 23.05.2022 22:05

I NEED HELP WITH THIS ERROR PLEASE


Fatal error: Uncaught mysqli_sql_exception: Unknown column 'body' in 'field list' in C:\xampp\htdocs\Homestyle1\assets\php\db.php:19 Stack trace: #0 C:\xampp\htdocs\Homestyle1\assets\php\db.php(19): mysqli->prepare('INSERT INTO top...') #1 C:\xampp\htdocs\Homestyle1\assets\php\db.php(101): executeQuery('INSERT INTO top...', Array) #2 C:\xampp\htdocs\Homestyle1\assets\Admin\topics.php(8): create('topics', Array) #3 C:\xampp\htdocs\Homestyle1\assets\Admin\topics\create.php(58): include('C:\\xampp\\htdocs...') #4 {main} thrown in C:\xampp\htdocs\Homestyle1\assets\php\db.php on line 19

Ответить
Jayjayyy
Jayjayyy - 30.12.2021 19:21

awa, please help me i followed your whole series and this is the first error that i cant fix.

Error:
Fatal error: Uncaught Error: Call to a member function bind_param() on boolean in C:\xampp\htdocs\handbook\app\database\db.php:18 Stack trace: #0 C:\xampp\htdocs\handbook\app\database\db.php(139): executeQuery('UPDATE departme...', Array) #1 C:\xampp\htdocs\handbook\app\controllers\department.php(32): update('department', '1', Array) #2 C:\xampp\htdocs\handbook\admin\department\edit.php(1): include('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\handbook\app\database\db.php on line 18

Ответить
MasterRAIN
MasterRAIN - 15.09.2021 13:23

Thank you so much Awa love and support from the 🇵🇭🇵🇭🇵🇭🇵🇭🇵🇭🇵🇭🇵🇭

Ответить
Hòa Nguyễn
Hòa Nguyễn - 04.09.2021 06:17

hi Awa, How do I display posts grouped by custom taxonomy?
I'm trying to group the same post $published = $post['published'];
this is how i do it and it doesn't work can you help me?!!!
<?php foreach ($topics as $topic): ?>
<h1 class="recent-post-title"><?php echo $topic['name']; ?></h1>
<hr>
<?php foreach ($posts as $post): ?>
<div class="">
<div class="">
<h2><a href="single.php?id=<?php echo $post['id']; ?>"><?php echo $post['title']; ?></a></h2>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>

Ответить
Hòa Nguyễn
Hòa Nguyễn - 02.09.2021 11:19

it's great, everyone followed from part 1 to now, everything works great, you helped me a lot, thank you so much

Ответить
035 Jasim_uddim
035 Jasim_uddim - 15.08.2021 10:25

Warning: include(C:\xampp\htdocs\blog\admin\topics/app/controllers/topics.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\blog\admin\topics\create.php on line 2

Warning: include(): Failed opening 'C:\xampp\htdocs\blog\admin\topics/app/controllers/topics.php' for inclusion (include_path='\xampp\php\PEAR') in C:\xampp\htdocs\blog\admin\topics\create.php on line 2
why show this type of error?

Ответить
Caitlin O
Caitlin O - 10.04.2021 07:30

Hi Awa! I love your work, it's so helpful! And I love the way you explain things ^_^.
I'm just having one problem though and I can't seem to resolve it whatsoever:

Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:\Users\Caitlin\Documents\xampp\htdocs\pandalingo\app\database\db.php:18 Stack trace: #0 C:\Users\Caitlin\Documents\xampp\htdocs\pandalingo\app\database\db.php(88): executeQuery('INSERT INTO top...', Array) #1 C:\Users\Caitlin\Documents\xampp\htdocs\pandalingo\app\controllers\topics.php(8): create('topics', Array) #2 C:\Users\Caitlin\Documents\xampp\htdocs\pandalingo\blog\admin\topics\create.php(3): include('C:\\Users\\Caitli...') #3 {main} thrown in C:\Users\Caitlin\Documents\xampp\htdocs\pandalingo\app\database\db.php on line 18

I tried to see what others have said and tried to implement their solutions but the error remains the same. Please help!

Ответить
𝕽𝖊𝖉𝖒𝖆𝖓
𝕽𝖊𝖉𝖒𝖆𝖓 - 04.04.2021 01:38

pls i need your help i am having a serious issue, and i'm working on a project, and i need to get through with it asap.... when working on the create topic i got an errror message as follows:


Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:\xampp\htdocs\management\app\database\db.php:16 Stack trace: #0 C:\xampp\htdocs\management\app\database\db.php(84): executeQuery('INSERT INTO top...', Array) #1 C:\xampp\htdocs\management\app\controllers\topics.php(7): create('topics', Array) #2 C:\xampp\htdocs\management\admin\topics\create.php(2): include('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\management\app\database\db.php on line 16



pls i would really appreciate if you can give a quick response.. thanks you

Ответить
Temi Owolabi
Temi Owolabi - 24.03.2021 22:00

Another great video! Thanks :)

Ответить
crypto crazy
crypto crazy - 29.10.2020 13:21

For people having issues with not being able to create topics.... in db.php, look at the create function and you will see -$sql = "INSERT INTO users SET ";-
change users to $table That should solve your issue.... same fix as Saffron mentions but without having to create another create functions. hope this helps someone

Ответить
poets263
poets263 - 07.09.2020 15:46

i am having an error Fatal error: Uncaught Error: Call to a member function bind_param() on bool in db.php:18 i need help i did as it has been done in your videos i checked many time but its not working

Ответить
PulseCoders
PulseCoders - 23.08.2020 19:24

Trying to access array offset on value of type null in C:\xampp\htdocs\Blog_Website\app\controllers\topics.php on line 23

why facing this problem?

Ответить
abdullah fajrutheen
abdullah fajrutheen - 04.08.2020 20:10

awa melvine please tell me what is your xampp server version

Ответить
Akif Bukhari_ Sb
Akif Bukhari_ Sb - 08.07.2020 16:08

Sir i am no able to add topic to database
Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:\xampp1\htdocs\blog1\app\database\db.php:24 Stack trace: #0 C:\xampp1\htdocs\blog1\app\database\db.php(105): executeQuery('INSERT INTO top...', Array) #1 C:\xampp1\htdocs\blog1\app\controllers\topics.php(7): create('topics', Array) #2 C:\xampp1\htdocs\blog1\admin\topic\create.php(3): include('C:\\xampp1\\htdoc...') #3 {main} thrown in C:\xampp1\htdocs\blog1\app\database\db.php on line 24

Ответить
anis arip
anis arip - 21.06.2020 13:33

the variable value="<?php echo $id; ?>" and others is undefined

Ответить
Joseph IB
Joseph IB - 09.05.2020 03:10

greetings Sir Awa, uhm i have a little problem...i keep getting this error sir Fatal error: Cannot redeclare executeQuery() (previously declared in C:\xampp\htdocs\Beatme808\admin\database\db.php:9). please how do i go about it sir. thanks

Ответить
Isaac ATTA AMPOFO SENIOR
Isaac ATTA AMPOFO SENIOR - 13.04.2020 23:21

Please any help


i got this error message


Fatal error: Uncaught Error: Call to undefined function create() in C:\xampp\htdocs\Project 2\Registration\controller\topics.php:10 Stack trace: #0 C:\xampp\htdocs\Project 2\BLOG\Admin\topics\createtopics.php(1): require_once() #1 {main} thrown in C:\xampp\htdocs\Project 2\Registration\controller\topics.php on line 10




These are my codes ....................


<?php
$db = mysqli_connect('localhost','root', 'godson10', 'registration');

if ($db->connect_error) {
die('Database error:' . $db->connect_error);
}

if (isset($_POST['add-topic'])) {
unset($_POST['add-topic']);
$topic_id = create('topics', $_POST);
$_SESSION['message'] = 'Topic created successfully';
$_SESSION['type'] = 'success';
header('location: ../../BLOG/Admin/topics/indextopics.php');
exit();
}

?>

Ответить
1bleed23
1bleed23 - 18.03.2020 14:07

Who has the error: Fatal error: Uncaught Error: Call to a member function bind_param () on boolean in ...
Change in file "create.php" <input type = "text" name = "title" class = "text-input"> to <input type = "text" name = "name" class = "text-input">

Ответить
Saffron
Saffron - 14.02.2020 11:49

Getting These Errors. I don't know what I've done wrong.

Fatal error: Uncaught Error: Call to a member function bind_param() on boolean in C:\xampp\htdocs\blog\app\database\db.php:19 Stack trace: #0 C:\xampp\htdocs\blog\app\database\db.php(90): executeQuery('INSERT INTO use...', Array) #1 C:\xampp\htdocs\blog\app\controllers\topics.php(8): create('topics', Array) #2 C:\xampp\htdocs\blog\admin\topics\create.php(2): include('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\blog\app\database\db.php on line 19




UPDATE: After adding the root path for the controllers/topics etc to the index.php file, it finally displays the message but the topic itself is not adding to the DB

Ответить
ApplePizzaPie Gaming
ApplePizzaPie Gaming - 03.12.2019 13:03

hi awa im getting this error upon testing creating my topics.....Fatal error: Uncaught Error: Call to a member function bind_param() on bool in C:\xampp\htdocs\blog\app\database\db.php:19 Stack trace: #0 C:\xampp\htdocs\blog\app\database\db.php(92): executeQuery('INSERT INTO top...', Array) #1 C:\xampp\htdocs\blog\app\controllers\topics.php(8): create('topics', Array) #2 C:\xampp\htdocs\blog\admin\topics\create.php(2): include('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\blog\app\database\db.php on line 19

Ответить
Gandepuun Lanshima
Gandepuun Lanshima - 19.11.2019 00:24

Hi Awa, great job thanks. Pls I ran into trouble with $topics_id = create('topics', $_POST); It says Fatal Error: uncaught error call to a member function bind_param() on bool in... executeQuery(INSERT INTO top.. ', Array)...
Every other thing works fine once I remove the creat function. My messages display fine but topic is not created in the data base... When I dump it in the browser dd($_POST); it works perfectly. Once in call on the create function as above.. I get that error...

Ответить
Vusi Mbhamali
Vusi Mbhamali - 15.10.2019 20:02

Awa, great tutorial. Please advice if this whole exercise can run on PHP 7?Thank you in advance.

Ответить
Gamtos Vaikas
Gamtos Vaikas - 02.10.2019 12:50

I can't get to fetch $description and other values after i click on Edit.
any advice?
code seems clear to me...

Ответить
Anthony Akro
Anthony Akro - 28.09.2019 16:57

Amazing content!!! I have been following up from the first video. Please how soon will the next video be uploaded? I am anxiously waiting.

Ответить
Urbain Romaric Bamana-Yangou
Urbain Romaric Bamana-Yangou - 24.09.2019 17:35

I have a suggestion, I know you have planned this course already and I don't know if you have plan of creating a 404 page and talking about .htaccess?
Thanks a lot.

You don't have to change your plan if you have not planned it.

But think of it

Ответить
DANIEL MBEDOBE
DANIEL MBEDOBE - 24.09.2019 02:27

thanks mate. God bless you.

Ответить
Waqas Khan
Waqas Khan - 23.09.2019 10:56

Thanks.

Ответить
Gureja Lectures
Gureja Lectures - 23.09.2019 10:44

Very good..
.

Ответить