Hey all,
I'm looking to see if there is some PHP syntax that I'm missing that will allow me to grab the contents of the array I just manipulated using a function..
Good example:
$firstElement = sort($myArray)[0];
Where normally I would have to do this:
$myArray = sort($myArray);
$firstElement = $myArray[0];
Any clean way of doing...
Hi, I'm trying to create a simple poll function using php and sql.
I have three tables:
Questions
Which simply contains each question asked
question_id | question_text | created_at
Answers
Which contains each answer for each question
question_id | answer_id | answer_text
Answered Questions
Which records who has voted for each opt...
Ok here is the situation (using PHP/MySQL) you are getting results from a large mysql table,
lets say your mysql query returns 10,000 matching results and you have a paging script to show 20 results per page, your query might look like this
So page 1 query
SELECT column
FROM table_name
WHERE userId=1
AND somethingelse=something else...
Which is the best way to debug an PHP application as we can debug ASP.NET application with Visual Studio ?
...
Hi,
I am relatively new to the Zend Framework.
I understand the usage of Zend_Table and can obtain data using the Zend functions from the table associated with that class.
For example I have a video table and in another table I have the association between the video and what category it is in.
Im a little stumped how to active a sele...
These are two of the options I have for exposing a PHP object to a Smarty template. I know that there are syntax differences between the two, but I can't find any information on why you would use one over the other. Can anyone explain the differences?
Thanks,
James.
...
Hi,
I'm doing a quote creator tool. There is a table that will store all the customer info. Then there is a quote table which will share the customer_id key and store all details of the quote.
I would like to store all details of the products quoted in the quote table. Now with a shopping cart you would have a products table with all t...
Am trying to create a grid calendar using PEAR and PHP but when I preview the file in my browser I get the following:
*Warning: include(Calendar/Month/Weekdays.php) [function.include]: failed to open stream: No such file or directory in /Users/x/Sites/p/testing pages/Pear_Date.php on line 8
Warning: include() [function.include]: Failed ...
How to print an xml file to the screen in php?
This is not working:
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, 'http://rss.news.yahoo.com/rss/topstories');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($curl);
curl_close ($curl);
$xml = simplexml_load_string($result);
echo $xml;
I...
Sorry, this looks longer than it probably is but I thought I should include all the information!
I'm using a simple Ajax script to dynamically bring content into a <div> on a page. The first request to load some new content into the div works fine, but if I've got an Ajax "back" link within the content which has just loaded, it seems to...
Ok Hi
Help help help
I am having a major problem with setTimeout it is not working and i did everything not working
I am developping a chat system so i need to send and recieve messages (i test it by opening 2 browser windows)
Here is the code i changed many times
I hope any one can help me
javascript
$(document).ready(function()
...
Ok I have read a lot of posts and articles on how GREAT eAccelerator is, I tested it on my home dev server and it slowed my pages down pretty noticably, could it be because:
I don't have a lot of RAM?
It only works to improve the speed of code sometimes?
All the hype is false?
Other?
...
I am using the following MySQL query in a PHP script on a database that contains over 300,000,000 (yes, three hundred million) rows. I know that it is extremely resource intensive and it takes ages to run this one query. Does anyone know how I can either optimise the query or get the information in another way that's quicker?
I need to ...
I'm working on a multilingual site using the new Zend Framework (1.8), but I'm running into some trouble with the URL routing. It might be that I interpreted its meaning incorrectly, but well, never too late to learn. So, what's basically happening:
The site consists of several parts, e.g. 'devices' and 'articles'. The plan is to form t...
I asked a question a while ago to sort out my directory structure and you all solved my problem (Thanks!) but im now changing this site to another server and rewrite rule does not work. I cannot find the problem. I sent a support ticked to the hosting and they said:
If that statement doesnt work then it will be either incorrect, or n...
Am trying to reload Apache 2 via /init.d/apache2 reload command in terminal but I get a command not found error and when I look at the etc/ directory in Finder I can't see any init.d folder. Is there somewhere else this init.d folder might be?
...
Do you know of any websites that allow users to share there custom PHP functions and code snippets other then? It would be nice to compile a list of a few good resources
http://www.phpclasses.org
...
Basically I have a variable which contains a few paragraphs of text and I have a variable which I want to make bold within the paragraphs. (By wrapping <strong></strong> tags around it). The problem is I don't want to make all instances of the word bold, or else I'd just do a str_replace(), I want to be able to wrap the first, second, fo...
When ever I try to call store procedure in mysql that sends back a result set, it keeps saying me that "can't return a result set in the given context".
I've google it and some said it's mysql bug, some said you should change your mysqli driver and ....
Situation :
Using mysqli driver Client API library version 5.0.51a , PHP Version ...
How can I say which class of many (which all do the same job) execute faster? is there a software to measure that?
...