I’m trying to make a very, very simple query of a small mysql database, using the following code (with appropriate values in $host, etc.): As you can see, I printed out the results in a human-readable way, yielding: There are a few example universities in that column, so I’m not sure what I’…
php: change value of variable based on dropdown list
Learning PHP and having an issue that I can’t figure out. I have read that PHP only has scope for functions, so I’m not sure why my switch statement isn’t changing the value of variables. Goal: to …
Resolve namespaces with SimpleXML regardless of structure or namespace
I got a Google Shopping feed like this (extract): Now, SimpleXML can read the “title” and “description” tags but it can’t read the tags with “g:” prefix. There are solutions on stackoverflow for this specific case, using the “children” function. But I don&…
Stripe making multiple customers with same email address
I have stripe check out with php. It creates customers and charges them. I want to create a donation form where if same customer comes back and gives with same email address that Stripe doesn’t create another customer but charges the existing customer with additional payments. Is this possible? Or does …
Implement Payum/Laravel recurring payment
I have some issues trying to get this working, I’ve implemented the checkout express (or seems to be) successfully, but also my system needs subscription option, following this example. Now, my …
Deleting rows in callback function in array_walk()
I’m trying to work with array using array_walk() function such way: ‘b1’, ‘n2’ => ‘b2’, ‘n3’ => ‘b3’); array_walk($array, function(&$val, $key) use (&…
Woocommerce – Prevent Adding items from two different categories to cart
I want to prevent users from adding products from different categories into cart at once. Say if the user navigates to another categories and tries to add product to cart, they get the cart cleared out first. Please anybody know how i might approach this? I am a newbie at things like this. Thanks Answer IR…
PHP & MYSQL: Convert rows and columns to json objects
I’m trying to get all of the rows and columns of a MYSQL table to be objects in an array so I can retrieve them via javascript. Here’s what I’ve got so far: <?PHP include '../sql.php'; $c = …
mysqli_connect() expects parameter 1 to be string, array given
I have an issue with mysqli_connect expecting the parameter to be a string and apparently an array is given I have a php file that writes the mysqli_connect information to a file from variables “…
Call to undefined function imagecreatefromjpeg() and GD enabled
im working on ubuntu 14.04 LTS with PHP 5.5.9 with GD enabled and i doubled check with but still showing me this msg everytime i try to use imagecreatefromjpeg() Fatal error: Call to undefined function imagecreatefromjpeg() in /../library/image.php on line 34 i even tried to check on it from command line by u…