My site is having around 100+ constants defined and this can potentially reach 200.
I'm using define() for defining constant.
Will this cause a performance hit ?
How many max constants can i define in PHP ?
...
How can I insert all dates in an year(or more) in a table using sql
My dates table has following structure
dates(date1 date);
Suppose I want to insert dates between "2009-01-01" to "2010-12-31" inclusive.
Is there any sql query for the above?
...
How to create a video uploaidng and playing website using php, mysql. any body can help me?
...
Hi,
I would like to know the popular ways of naming files in JavaScript and PHP development. I am working on a JS+PHP system, and I do not know how to name my files.
Currently I do for JS:
framework/
framework/widget/
framework/widget/TextField.js (Framework.widget.TextField())
Framework.js (Framework())
So, my folders are lowercase...
Hi There,
I just moved my website to a new server (Shared to VPS)
I expected errors, and the only error that is really puzzling me is this SQL statement.
echo mysql_query("SELECT COUNT(*) FROM users_online_now")
This returns nothing! And if I try the mysql_num_rows, it returns
mysql_num_rows(): supplied argument is not a valid MyS...
Me and my friend started working together as partners , we have decided to make Kick-as* website after website.
We have the ideas written down like 100's of them (yes we are choosing best and easy among them first).
My friend does the layout design and arranging things , and my part is coding and server management.
The little problem ...
if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile)) && $_SERVER['REQUEST_URI'] != "login" || "thankyou" || "confirm")
Should this code work, operators wise and syntax wise?
...
How can i convert mysql results (from mysql_fetch_array) into such a form?
$some = array(
"comments" => array(
array( "text" => "hi", "id" => "1" ),
array( "text" => "hi", "id" => "2" ),
array( "text" => "hi", "id" => "3" ),
array( "text" => "hi", "id" => "4" )
)
);
while the db looks like:...
I've been trying to do some PHP work on my snow leopard machine.. but I've found issues when I need to use PEAR packages (as symfony handles its php plugins with PEAR).
I've found some references that state that snow leopard includes PEAR.. but how come I cant find it?!
Could someone confirm this.. if if so, where is my pear?
...
Hi,
We were given an assignment to develop a prototype for a customer community. It was suggested PHP as the programming language. (but we're not supposed to actually code it, just a prototype with documentation is required)
I'm wondering what are the best practices/ tools used in Unit testing, Integration Testing and System testing for...
Hello,
I want to check if an URL exists using PHP. for eg. If someone enters www.adflkjweoifj123912873.com, I want to check if this domain has a website, or its live on the web.
Thanks
Jean
...
I want insert query statement in DB for LOG.
Is there a way that i can read from mysql binarylog file with php code and insert query statement in DB?
...
I want my site to have a feature for users to upload images, but I want to do it safely. Namely, I want to strip the EXIF data and any malicious code that could be in their image. I was thinking of a way to do this involving direct manipulation of the file, but it struck me, would it make more sense to just convert the image they provide...
here my code -
if($pin == '105') {
$sqltree = "INSERT INTO tbltree (`userId`, `level`, `superId`, `rootId`, `childcount`)
VALUES ('$child1', '1', '$newid', '$myroot', '0');";
mysql_query($sqltree);
update_level($newid);
}
function update_level()
{
//for 1st level
$newid = $_S...
How can convert the below youtube urls
$url1 = http://www.youtube.com/watch?v=136pEZcb1Y0&feature=fvhl
$url2 = http://www.youtube.com/watch?feature=fvhl&v=136pEZcb1Y0
into
$url_embedded = http://www.youtube.com/v/136pEZcb1Y0
using Regular Expressions?
...
Hi all..
First of all, this isn't another question about storing images on DB vs file system. I'm already storing the images on the file system. I'm just struggling to find a better way to show them to all my users.
I' currently using this system. I generate a random filename using md5(uniqueid()), the problem that I'm facing, is that ...
I have data like:
Audio 1 Test
File 10
Audio 2
Audio 3
File 11
Audio 1
Audio 13
Audio 22
File 20 Test
Test File 22
Audio 10
File 1
File 2
I need it order first by the text (i.e. Audio, File, Test) and then by number (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 etc.)
The problem is that sorti...
I have index.php which uploads a file to server and sets several PHP variables (like $target_folder_and_file_name).
index.php also has the following line (it was originally index.html):
<script language="JavaScript" src="main.js.php"></script>
After index.php returned to the browser, the browsers asks for main.js.php from the server ...
I want to imitate Google suggest with the following code, which means:
step 1: When user types in search box, the query string will be processed by a server php file and query suggestion string is returned(using Ajax object).
step 2:When user clicks on a query suggestion, it will fill into the search box (autocomplete).
Step 1 is a...
I need a good implementation of AOP paradigm for Codeigniter PHP Framework.
What do you suggest me?
...