Questions tagged as 'php'

2
answers

make consultation with three tables in Eloquent Laravel

I have three tables that are the following users , maps , bookmarks A user has several maps a map has several markers What I am trying to do is show the markers that belong to the maps of the user who has logged in. This is...
asked by 22.10.2018 / 16:47
1
answer

I have a FOR in PHP and I need a row to show me option A and the other row option B

I have a question. Currently I have a timeline in html which shows me one on the right and the other on the left, but I want to integrate it with dynamic data. To put right start only with <li> But to put it to the left I start i...
asked by 24.10.2018 / 18:52
2
answers

Routes of Laravel

Thank you in advance, I am working on a CMS and I want to separate the backend routes and the front routes but I have conflicts. The backend is currently in / admin and whatever follows, for example / admin / users / etc ... The proble...
asked by 25.10.2018 / 01:39
1
answer

How to update several records in Mysql from PHP?

My question is how can I update several records of a Mysql table from php? In the variable $ conver2 the values that I want to insert are saved I put the update inside the foreach so that the sentence would be repeated according to the amo...
asked by 07.05.2018 / 22:26
3
answers

Validate JPG or PNG PHP image

Well the point is that I do not know how to validate the following, in the database I capture the url of an image and then I show it with a echo in php, what I try to do is validate the image either jpg or png to then export it in an exce...
asked by 07.05.2018 / 07:09
1
answer

Error in sentence usanto query ()

I'm doing an internal query and I want to get a field ( idperiodo which is integer ), there should only be one record with the field Active that's why I use limit 1 . I have this code: public function buscar_campo() { try {...
asked by 06.05.2018 / 17:37
3
answers

laravel 5.5 I need to include a variable inside a json type array

I need to include $ token within the $ user array where I save my query, I'm using the laravel 5.5 framework protected function respondWithToken($token,$documento){ $user = User::select('id','nombre','email')->where('documento', $docum...
asked by 09.05.2018 / 21:39
1
answer

copy php file

I have this copy function $srcfile='C:\xampp\htdocs\imagenes\M1001.jpg'; $dstfile='C:\xampp\htdocs\imagenes-copiadas\M1001.jpg'; mkdir(dirname($dstfile), 0777, true); copy($srcfile, $dstfile); I need the name M1001.jpg to be a variable call...
asked by 26.05.2018 / 10:49
1
answer

Execute on unprepared sentences

This is a question of concept consultation. The prepared statements protect the sql injection query. $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < :calories AND colour = :colour'); $sth->bindParam...
asked by 07.05.2018 / 05:33
2
answers

Error consulting text with emojis in mysql

Update ... I have the following table: CREATE TABLE 'chrislat_cms'.'opciones' ( 'id' INT(11) NOT NULL AUTO_INCREMENT , 'nombreOpcion' VARCHAR(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , 'valorOpcion' LONGTEXT CHARACTER SE...
asked by 29.05.2018 / 06:22