PAQ : Build Complete CMS Blog in PHP Mysql Bootstrap from Scratch
Hi,
This Page will give present possible answers to questions of Jazeb’s Course “Build Complete CMS Blog in PHP MYSQL Bootstrap from scratch“. Try to find your questions keyword in this page and you will get all the steps to find the right answer.
Q:
Database question mysql mysqli syntax
See Lecture “Working with DataBase” inside course curriculum.
Check out following Information
Download XAMP SERVER 3.2.2 for running only mysqli
https://www.apachefriends.org/index.html
Download XAMP SERVER 3.2.1 for running both, mysql and mysqli
LEARN mysqli FUNCTIONS SYNTAX

$Connection=mysql_connect("localhost","root"," "); $Selected=mysql_select_db("Put Your Data Base Name here",$Connection);
Error functions
error.mysql_connect(); error.mysql_select_db();
Other Major Functions in mysql
$Query="SELECT * From emp_record "; $Execute=mysql_query($Query); mysql_fetch_array($Execute) mysql_real_escape_string($Varriable);

$Connection = mysqli_connect("localhost","root","","Put Your Data Base Name here");
Error functions
mysqli_connect_error(); // for showing error message if something went wrong mysqli_connect_errorno(); // for showing error number if we have any error
Other Major Functions in mysqli
$Query="SELECT * From emp_record "; $Execute=mysqli_query($Connection,$Query); mysqli_fetch_array($Execute) mysqli_real_escape_string($Connection,$Varriable);
Connection Code in Mysql Mysqli

<?php $Connection = mysqli_connect("localhost","root","","YourDataBaseName"); // Check connection // mysqli_connect_error(); for showing error message if something went wrong // mysqli_connect_errno(); for showing error number if we have any error if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } mysqli_close($Connection); // Function for closing connection at the end of the page/work when you are done ?>
<?php $Connection=mysql_connect('localhost','root',''); if($Connection){ echo "DataBase Connected <br>"; } else{ error.mysql_connect(); } $Selected=mysql_select_db('YourDataBaseName',$Connection); if($Selected){ echo "DataBase Selected"; } else{ error.mysql_select_db(); } ?>
See my course “Learning PHP Data Objects PDO” for a better database application.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Best,
Q:
Set Default image at time of updating post
Hi,
if condition might work if you dont want to change the previous image to empty one at the time of post update.
if(!empty($_FILES["Image"]["name"])) { $query = "UPDATE post SET datetime='$dateTime',title='$title',category='$category',author='$author',image='$image',post='$post' WHERE id='$postToEdit'"; } else { $query = "UPDATE post SET datetime='$dateTime',title='$title',category='$category',author='$author',post='$post' WHERE id='$postToEdit'"; }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Q:
PHP 7 OR PHP 5.6
Hi,
The Future of PHP is bright. 🙂
When we talk about php versions, they introduced new features and never ever removed something without replacing it with something useful. So if you compare PHP 5.6 and with 7.1 the newer version has namespace and other new classes but all the php 5.6 is fully supported in 7.1 with the miner new additions. that’s good right!
If the newer version dont offer old functions and syntax it wont gonna attract lazy developers (e.g Angular JS).They deprecated mysql after 5.6 and all developers had time to learn mysqli syntax. Now, PDO (my PDO course is just went live) has replaced the need of mysqli too. but you can still use mysqli as well because its fully supported.
As for newbies, 7 out of 10 will find mysql (deprecated) syntax a lot difficult. So i designed my PHP Series to move forward step by step.
Best,
Jazeb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Q:
Bootstrap Installation and file Configuration Problem in New Version
Hi,
Bootstrap released new version 4.
if you try to connect you will probably get this error in console panel

So read this article if you face it
https://github.com/twbs/bootstrap/issues/23381
OR
you can connect bootstrap from Quick start CDN
Link: https://getbootstrap.com/docs/4.0/getting-started/introduction/#quick-start

Best,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Q:
URL POST ID IS NOT GETTING FROM URL / POST IS NOT UPDATING
Hi,
Go to lecture 14. download coding exercises. In the file of FullPost.php On line 14 we made
$PostId=$_GET["id"];
means we are getting the id of post from URL . So if you skip this line or Have some URL Like Fullpost.php?id= it wont gonna work
So there should be some id in URL before submitting it
if($Execute){ $_SESSION["SuccessMessage"]="Comment Submitted Successfully"; Redirect_to("FullPost.php?id={$PostId}"); }
Your Comments form should be like this
<form action="FullPost.php?id=<?php echo $PostId; ?>" method="post">
Your Browser should be like this

and for code
Visit coding exercise
Q:
Bootstrap nav-stacked pills
Hi,
Its possible they have removed it or change it with other. Visit Bootstrap for the latest support.
Check the Link : https://v4-alpha.getbootstrap.com/components/navbar/
Best,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Q:
login system | function Login_Attempt($Username,$Password) is not working
Hi,
1st remove this function
Login_Attempt($Username,$Password){ }
from your function file completely. save it and close your file.
Clear your browser(chrome/firefox) cache.
restart computer.
Now write this function
Login_Attempt($Username,$Password){}
in another file say Test.php
Now open the function file and paste it here.
Conclusion: Write your function in another file and past it directly into your function file without writing in it. Check.
See my course Learning PHP Data Objects PDO for writing a better login system application.
Best,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Q:
Source Codes of course
Hi,
Go to following link download coding files.
Complete Coding Exercises —–> Go to this link
https://www.dropbox.com/sh/9fog9y1b7l32m4i/AADNpIfb5JxJNTIGSKBh9ZhPa?dl=0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Q:
syntax error or undefined variable on some line
Error: undefined variable / Syntax Error on some line
Solution: Compare your code with the source codes available inside the curriculum of this course
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End
Best,