Skip to content

php- switch fails before i select an option

I’m having a problem with php switch function. I know it must be simple, but i’m just learning and I can’t seem to find the right way to code it. This is the issue: It works fine when you click any of the options, but it sends an error msg when I first load up the page… Now, I suppose

PHP – Best way to get meta data from comments

PHP has a function called get_meta_tags which can read meta tags of HTML files. However, as far as I know there is no standard way to define meta tags for PHP files. The de facto solution seems to be to add comment to the top of the file like so: Is there any way to read these “meta tags” with

Display related posts from the same category. Using PHP and MySQL

I have a blog site in PHP and MySQL with tow table, POST and CATEGORIES. I need help, how to display related post from same category when visitor clicked on a single post title. your help will be greatly appreciated POST table POST_ID CAT_ID TITLE DESCRIPTION IMAGE 1 3 2 5 3 1 4 6 CATEGORIES table Cat_id Cat_…

How to run migrations even if the table already exist?

I ran php artisan migrate:fresh to delete every table, then I have a sql dump file that also creates the tables and populates them with some data. However then I also need to run php artisan migrate since there are some migrations that are needed to add some extra columns to some tables (and these columns are…