I am beginner in Laravel. I use migrate to create tables in a database, but I don’t want to migrate:rollback to update my table. I want to apply changes in my old database without loosing current …
Tag: mysql
Laravel 5.1 – Checking a Database Connection
I am trying to check if a database is connected in Laravel. I’ve looked around the documentation and can’t find anything. The closest thing I’ve found is this, but this doesn’t solve my problem. I have three instances of MySQL that are set up on different machines. Below is a simplifie…
Mysql password expired. Can’t connect
I just wiped my Mac and did a fresh install of El Capitan. I’m struggling to connect to Mysql now. Having gone through a web server setup process, I’ve created a simple PHP test file: <?php $…
mysql_query returns TRUE for SELECT statement [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 29 …
how to get updated id in codeigniter
i’m new to Codeigniter, but learning from web, actually i got stuck with a unknown proble. im inserting data into the database throw the model, and fetching back the data into form. but when i’m …
MySQL error because of syntax in Custom PHP code
I am trying to enter user’s data into a database. I think the commas in the address are causing the error. <?php $full_name = $_POST["fullname"]; $email = $_POST["email"]; …
How to create PDO connection in __construct()?
I have one class that is containing three methods. All of those methods need to database, Then I want to create a system for connection to database before everything. Something like this: Now I want to know (in first) what I did is a standard approach? and (in second) how can I check [if connection was discon…
Warning: mysql_query(): Access denied for user ‘admin’@’localhost’ (using password: NO) [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 6 years ago. Improve this question It seems as though my PHP is trying to log in to the MySQL database w…
How to execute raw queries with Laravel 5.1?
So I have this tiny query to run on my DB and it works fine in MySQL Workbench. Basically, a SELECT with LEFT JOIN and UNION with LEFT JOIN again. SELECT cards.id_card, cards.hash_card, …
How to calculate total price in php
I am getting the price of the product from db using the product id i have stored in php array. i have a php function where in i want to hold a total of all the products purchased. here i am getting the cart items and i am calling the function which should hold total amount. i am passing the