This might be easy for you guys but i could't get it.
I have a php class that query the database and return the query result. I assign the result to an array and wants to use it on my main.php script. I have tried to use echo $var[0] or
echo $var[1] but the output are 'array' instead of my value. Anyone can help me about this issue? Th...
We have so many ORM (Object Relational Mapping) software:
http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#PHP
How about API to Object mapping?
Edit
We don't use database, but API. So all data come from REST APIs.
Classic ORMs do not seem to handle that. Looks like I should do my own using Zend's code generator...
Hi all, I was wondering if anyone could help me out, I'm trying to find a script that will check my entire array and remove any duplicates if required, then spit out the array in the same format.
Here's an example of my array (as you will see there are some duplicates):
Array
(
[0] => Array
(
[0] => stdClass Obj...
It seems to me that it is rendundant information as the usage of the class will make it apparent that it is an exception. Furthermore, in PHP, the class must extend the Exception class so it will be apparent that it is an exception when looking at the class on its own.
Despite this, developers usually apply the suffix 'Exception'. Why i...
Am I using TwitterScript to retrieve Twitter data for inside a Flash site. Due to Twitter's crossdomain policy, I need to setup a php proxy...
Firstly I made a simple one
<?php
$url = $_GET['url'];
readfile($url);
?>
but I then get this error
URL file-access is disabled in the server configuration
which is only resolved by getting...
I am working on a widget that is a lot like twitters widget where there is a list of postings and a view more button. I can get it to work with using ID variables but I would like to sort by popular posts.
Here is my mysq code:
$sql = "SELECT id, title, category, icon_normal, status, description, views_monthly FROM posts WHERE views_mo...
I'm designing a web application.
I was wondering if it was feasible to design a php front end (using some php framework e.g. CakePHP), which stores and retrieves data to display to the user.
Then develop a java backend which listens to the database for changes, and depending on what was changed, performs some actions and updates the da...
I have 2 databases. One is properties and the other is dates. In dates I have associated the land_id and a date (In YYYYMMDD format) which means that the date is not available.
I need to formulate a query that a user can specify a start and end date, and then choose a property for which dates are available (not in the date database). H...
I have a function that is supposed to split my array into smaller, evenly distributed arrays, however it seems to be duplicating my data along the way. If anyone can help me out that'd be great.
Here's the original array:
Array
(
[0] => stdClass Object
(
[bid] => 42
[name] => Ray White Mordialloc
...
There are multiple times in one page where I need to connect and subsequently query a MySQL database, yet my code won't let me. I think it might be something to do with how my files are nested but it makes no sense. I am opening the SQL connection in the header file. The top of the offending page looks like the following:
<?php
$page_t...
Hello.
I created a CodeIgniter application and now I'm trying to redirect the urls with index.php to urls without it.
My current .htaccess is:
RewriteEngine On
RewriteBase /
# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]
# Enforce www
# If you h...
While following the symfony tutorial (1.4.4) I'm getting an error with ODBC/mssql 2008.
SQLSTATE[07002]: COUNT field incorrect: 0 [Microsoft][SQL Server Native Client 10.0]COUNT field incorrect or syntax error (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:254). Failing Query: "SELECT [j].[id] AS [j__id], [j].[category_id] AS [j__category_...
When users edit their account, I want to display a confirmation page that shows their updated information with the fields that they changed in bold. Is there a mysql statement that allows you to select the fields that a user changes? If not, how exactly can I achieve this
Ex:
(editaccount.php)
first_name: bob
last_name: builder
email:...
I am trying to display a WordPress post on the homepage of a site. It is reporting the following error:
Parse error: syntax error, unexpected '=' in /home/####/####/####/####/wp-content/themes/oceanswaves/home.php on line 105
<?php query_posts(‘p=143′); if(have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>
Than...
Hi!
I searched before I ask, without lucky..
I looking for a simple script for myself, which I can search for files/folders. Found this code snippet in the php manual (I think I need this), but it is not work for me.
"Was looking for a simple way to search for a file/directory using a mask. Here is such a function.
By default, this ...
Logging into a site I'm working on functions as expected on my local machine but fails on the remote server but ONLY in Internet Explorer. The kicker is that it works in IE locally, just not on the remote machine.
What in the world could cause this? I have stepped through the code on the remote machine and can see the entered login valu...
I am using Python for indexing utilizing the shelve functionality and I was wondering whether it was possible to open and read the files in PHP.
I checked out the PHP Shelve option and it doesn't seem to be working on PHP 5.X I am getting (when running the example they gave me)
PHP Fatal error: Cannot pass parameter 2 by reference i...
in PHP i used session and cookie not urlrewriting with PHPSESSID.
but when i opened cookie then i saw the key value pair.but one of them is
path : /
what does path mean,can you explain elaborately.
if i change the path value to /abc/cdddddddddd/efc then what does that mean?
...
I'm relatively new to MySQLi prepared statements, and running into an error. Take this code:
$user = 'admin';
$pass = 'admin';
if ($stmt = $mysqli->query("SELECT * FROM members WHERE username='$user' AND password='$pass'"))
{
echo $stmt->num_rows;
}
This will display "1", as it should.
This next piece of code though, returns "0"...
I have the following php code:
index.php
<?php
spl_autoload_extensions(".php");
spl_autoload_register();
use modules\standard as std;
$handler = new std\handler();
$handler->delegate();
?>
modules\standard\handler.php
<?php
namespace modules\standard {
class handler {
function delegate(){
echo 'Hello from d...