php

  • PHP Order by last name with middlename 2017-12-16

    I have a database field called last_name. I want to order the list by last name. Here is an example: Name Jan DSmit Jan van de WSmit Jan van ASmit Jan de FSmit I tried doing this with SUBSTRING INDEX but that only searches a space. I have multiple. I

    Tags: php, mysql, wordpress, order
  • Explode by comma and new line together 2017-12-12

    This question already has an answer here: How to split a string by multiple delimiters in PHP? 4 answers I have a basic textarea. When user enter some text I explode words by comma ",". Now I also want to seperate words by new line. How can I do

    Tags: php, string, arrays, explode
  • What does $_SERVER on its own do? 2017-12-12

    I have come across the following three lines of code: $_SERVER; $_ENV; $_REQUEST; To me it seems like these three lines of code do nothing. They don't cause any errors. I know what these three global variables are, I just don't know what these three

    Tags: php, global variables, noop
  • PHP good practices - Echo usage 2017-12-09

    I've programmed for many years now in c++/c/python but never did a project in PHP, which I will be doing soon. 1- I find the usage of echo to be somewhat annoying, especially for printing long stuff. For example, if I have a function which wants to e

    Tags: php, echo
  • Display the customer's title column on a Magento PDF invoice 2017-12-09

    I am trying to modify the Print PDF output in my Magento admin interface to display the customer's title. This is already working to display the name: $this->getCustomer()->getName() The programmer who worked on this site before me had the following

    Tags: php, magento
  • How to remove and special characters like &#�? 2017-12-06

    I'm trying to develop the dynamic site using php and mysql. I need to extract limited contents from my database so I've used substr but I'm troubled with unnecessary enter so want to remove enter (br) and special characters like &#�?. My code looks l

    Tags: php, mysql
  • What is the best way to structure the following database query in Laravel 2017-12-04

    I am really having trouble constructing a query that meets the following criteria. Where the start date is today/future OR 0000/00/00 Where the end date is today/future OR 0000/00/00 Where views more than 3 Here is what I have so far. $users = DB::ta

    Tags: php, mysql, laravel, eloquent
  • PHP get XML node attributes when value exist 2017-12-03

    I want get the whole XML contents, but the results only show node value, node attributes are missing. XML File: <main> <people num="1"> <name num1="1">Jack</name> <age num2="1">50</age> <

    Tags: php, simplexml
  • How to save the name of the image from an input file 2017-12-03

    I have a field type string called image_cover on my database. I have a field type file on my form: <?php echo $this->Form->create($event, ['type' => 'file']) echo $this->Form->file('image_cover') echo $this->Form->submit('Send') ec

    Tags: php, cakephp 3.0
  • Search page in subdirectory with extra parameter in friendly URL (htaccess) 2017-11-30

    My htaccess is currently # rewrite engine on and setting up base RewriteEngine On RewriteBase /leffa # replace + with _ RewriteRule ^(.+)\+(.+)$ $1-$2 [R=301] # external redirect from action URL to pretty one RewriteCond %{THE_REQUEST} /index(?:\.php

    Tags: php, search, apache, mod rewrite, .htaccess
  • MySQL find only different in 2 table 2017-11-28

    I have 2 table in mysql. table1 and table2. In table1 is number, email and phone number. In table 2 same, but sometime different email or phone number. i want to list of records where number is same and email or phone number different. sometime both

    Tags: php, mysql
  • PHP Allowed memory size exhausted 2017-11-28

    Everytime I execute the code below, I get this error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 133955562 bytes) in /home/vhosts/schoolvids.nl/subdomains/admin/httpdocs/home.php on line 100 Line 100: $response .

    Tags: php
  • php UPDATE and SELECT in same query 2017-11-26

    I am trying to make a double query in php and doesn't work for some reason. Basicall I want to update a row in my table where the id is MAX and the fb_id it's equal to fbId parameter. Here is my code: public function updatePages($fbId, $nr_page = NUL

    Tags: database, php, mysql
  • How to not include in regex a literal after including it in the first group? 2017-11-23

    I am using preg_match_all() to match some strings. this is my code preg_match_all('@([a-zA-Z0-9,\(\)\-\s\.\#:]*)Date From: [0-9]{2}/[0-9]{2}/[0-9]{4}([, \s]*[0-9]{2}/[0-9]{2}/[0-9]{4})*\s(Division Type: [A-Z ]*)*@m', $string, $match); this is the out

    Tags: php, regex, preg match all, capturing group
  • Use data from mysql in HTML row 2017-11-17

    I have a web page where i am pulling data from a mysql database and I want to be able to check a checkbox and change information within the table. The way I am displaying the information is as follows: <?php $get_tickets = mysql_query("SELECT * FR

    Tags: php, mysql, html, table
  • how to enable extension (openssl,-) without access to php.ini? 2017-11-16

    I'm using codeigniter for sending mail but i have problems with my shared host, because I can't access php.ini so i have these errors: A PHP Error was encountered Severity: Warning Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:

    Tags: php, email, gmail, .htaccess, codeigniter
  • SageOne Accounts API in PHP 2017-11-15

    I have found an API class (https://github.com/eddieharrison/sageone-api-php) in PHP for the SageOne Accounts Cloud Software. I used the code found in auth.php with my apps CLIENT_ID and CLIENT_SECRET to gain an access code. I then tried this code (/e

    Tags: php
  • How to format data in specific way using html and php 2017-11-13

    I have a table that contains Aspiring team for particular positions and various vote casted. The data is below Teamtable | no | team | position | votes Cast | | 1 | A | President | 2 | | 3 | B | President | 1 | | 4 | C | Secretary | 2 | | 6 | D | Sec

    Tags: php, mysql, html
  • Mysql How can i fetch 2 sets of results in single query from same table? 2017-11-12

    i have mysql table of comments , like this. +------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+------------------+------+-----+---------+----------------+ | userid |

    Tags: php, mysql, join
  • How to add NotBlank validation in frontend for FosUserBundle login form 2017-11-10

    I am using FOSUserBundle to manager the users on my site. For authentication, I have implemented the form login and configured it in 'security.yml' : form_login: provider: fos_userbundle csrf_provider: form.csrf_provider default_target_path: / It is

    Tags: php, forms, security, symfony2, fosuserbundle

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 5.094 (s). 7 q(s)