The code above gets the value from genreID when dbGenre is equal to $genre. And then store the results in an array. But it’s not working because $genre is an array, so I need to loop through it to get a different value from genreID each time. The ‘genres’ table contains two columns: genreID (INT) and dbGenre (VARCHAR) I just
Tag: php
How to know for sure if FastCGI is being used to run php scripts
I have a hosted site and I’m having trouble configuring Joomla (running Joomla + php + mySQL on IIS7 + win server 2008). I have a similar configuration running on a local machine (Joomla + php + mySQL on IIS7 + vista x64), so I was at least able to follow instructions showed in various tutorials on how to set
Select from MySQL records that sums
I’m using PHP and MySQL. I have a table named quantity. Inside there are records of product name, product price and product quantity. Besides these, there are a few others that helps me select the last records based on date and position, as well as a GROUP BY the field named price because there are different quantities with different prices
Object-oriented-like structures in relational databases [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year. Improve this question Folks, For the n-th time in a row, i’m hitting the same old problem again. It’s about “how do I map OOP
PHP expects T_PAAMAYIM_NEKUDOTAYIM?
Does anyone have a T_PAAMAYIM_NEKUDOTAYIM? Answer It’s the double colon operator :: (see list of parser tokens).
geoip + pecl + 64 bits box
Has anyone tried to install geoip over pecl on a 64bits box? I can install geoip just fine using these commands on my 32bits fedora box. I can’t on the 64bits version. Any ideas why? yum install make gcc cpp gcc-c++ glibc glibc-headers php-pear php- devel geoip geoip-devel pecl install geoip => on the 64bits version it breaks here with
How do you reindex an array in PHP but with indexes starting from 1?
I have the following array, which I would like to reindex so the keys are reversed (ideally starting at 1): Current array (edit: the array actually looks like this): How it should be: Answer If you want to re-index starting to zero, simply do the following: If you need it to start at one, then use the following: Here are
How do I create a PDO parameterized query with a LIKE statement?
Here’s my attempt at it: Answer Figured it out right after I posted:
Dividing with a remainder in PHP
I have a part in my code where I need to divide and have a remainder instead of a decimal answer. How can I do this?
How to use $_SERVER[‘REQUEST_URI’]
Is there any difference between typing: or or ? They all work… I use the first one. Maybe one is faster than the other? Answer Without quotes PHP interprets the REQUEST_URI as a constant but corrects your typo error if there is no such constant and interprets it as string. When error_reporting includes E_NOTICE, you would probably get an error