Yo.
I'm trying to find a way to insert a whole database structure into MySQL with PHP. Now, my main question is if there's any way to do this beyond just inserting the whole bloody thing line by line?
Thanks.
I have some testcases/strings in this format:
o201_01_01a_Testing_to_see_If_this_testcases_passes:without_data
o201_01_01b_Testing_to_see_If_this_testcases_passes:data
rx01_01_03d_Testing_the_reconfiguration/Retest:
Actually this testcase name consists of the actual name and the description.
So, I want to split them like this :
o201_01_01a Testing_to_see_If_this_testcases_passes:without_data
o201_01_01b Testing_to_see_If_this_testcases_passes:data
rx01_01_03d Testing_the_reconfiguration/Retest:
I am unable to figure out the exact way to do this in explode in php
Can anyone help please?
Thanks.
So I need to encode an array in PHP and store it in plain text in MySQL database, my question is should I use serialize() or json_encode()? What are the advantages and disadvantages of each of them?
I think either of them would do in this situation. But which one would you prefer and why? If it is for something other than an array?
Ok, so I'm the author of a CMS and I'm interested in building a CalDAV-server that enables the user to interface with my CMS through CalDAV instead of only through the web, so they can see their calendars, add todos and things like that.
I've looked at http://www.davical.org/ which is a CalDAV service built in PHP, but it has its own database and I already have the DB stuff done and just want a middle-layer services that translates, both ways, to and from my databases using my functions.
Any ideas?
This below output come from php json_encode.What we see here is 0849 is twice.Since javascript only use sn to get value why we need the "0" value.The main problem is speed execution. If 800 kb data might can be reduce to 400 kb
{"success":"true","total":968,"data":[{"0":"0849","sn":"0849" }]
If no solution i have to make a script to filter in json_encode so no need twice data transter.
ereg and eregi functions will be deleted from Php. Please help to find alternatives for the following ereg functions:
1) To allow IP addresses only for specific ranges:
$targetAddr = "60.37..*..*";
if (!ereg($targetAddr, $_SERVER['REMOTE_ADDR'])) {
die;
}
2) To replace series of points like .......................
$message = ereg_replace("[.]{3,}", "... ", $message);
Hi,
Is there a way to create a new MySQL database, a new MySQL user and give the new user priviledges on the new database all using PHP?
I've seen examples where mysql_query is used like this:
mysql_query("CREATE DATABASE ".$dbname)or die(mysql_error());
but i don't see how this would work as there's no database connection.
Help please!
can someone please give me an example on the internet of how the system of discount coupon generation and redemption is implemented using php .
Any help appreciated.
Regards
SK
I would like to ask is there any way change the comment code template in Netbeans PHP 6.8
In eclipse, when I type /** ENTER , it would come out the comment template that I set in the setting, like this:
/**
* Apr 19, 2010 - Shiro
* Description
*
* @return unknown_type
*/
function test()
{
}
by Default Netbeans only will show the parameter in the function.
/**
*
* @param <type> $order_No
* @param <type> $array
*/
in Netbeans is there any possible I could found any customization about this, anyone know where is the setting for this?
Hi,
I'm just wondering if there's a web hosting site that offers hosting for PHP and ASP.NET at the same time. It would be great if you give me a site that offers free service. I would like to use it for testing purposes only. But I could still look for affordable one.
Comments/Suggestions are welcome. Thanks.
This is an array of objects showing a user uploading photos:
Array
(
[12] => stdClass Object
(
[type] => photo
[created] => 2010-05-14 23:36:41
[user] => stdClass Object
(
[id] => 760
[username] => mrsmith
)
[photo] => stdClass Object
(
[id] => 4181
)
)
[44] => stdClass Object
(
[type] => photo
[created] => 2010-05-14 23:37:15
[user] => stdClass Object
(
[id] => 760
[username] => mrsmith
)
[photo] => stdClass Object
(
[id] => 4180
)
)
)
However instead of showing:
mr smith uploaded one photo
mr smith uploaded one photo
I'd like to display:
mr smith uploaded two photos
by grouping similar items, grouping by user ID and them having added them within, let's say 15 minutes of each other. So I'd like to get the array in this sort of shape:
Array
(
[12] => stdClass Object
(
[type] => photo
[created] => 2010-05-14 23:36:41
[user] => stdClass Object
(
[id] => 760
[username] => mrsmith
)
[photos] => Array
(
[0] => stdClass Object
(
[id] => 4181
)
[1] => stdClass Object
(
[id] => 4180
)
)
)
)
preserving the first item of the group and it's created time, and supplementing it with any other groupable photos and then unsetting any items that were grouped (so the final array doesn't have key 44 anymore as it was grouped in with 12).
The array contains other actions than just photos, hence the original keys of 12 and 44. I just can't figure out a way to do this efficiently. I used to use MySQL and PHP to do this but am trying to just use pure PHP for caching reasons.
Can anyone shed any insights? I thought about going through each item and seeing if I can group it with the previous one in the array but the previous one might not necessarily be relevant or even a photo. I've got total brain freeze :(
Hi,
http://mysite.com/songs/company-name/song-name
i want to redirect it to
http://mysite.com/songs/index.php?name=company-name&song=song-name
i read some articles about that mod_rewrite but actually i couldnt understand exactyly, i appreciate if you can help me.
thanks
Just a little confused here...
I have a function in postgres, and when I'm at the pg prompt, I just do:
SELECT zp('zc',10,20,90);
FETCH ALL FROM zc;
I'm wondering how to do this from php?
I thought I could just do:
$q = pg_query("SELECT zp('zc',10,20,90)");
But, how do I "fetch" from that query?
Does anyone have any good ideas for an intermediate PHP developer? My current projects are mostly developed, and with school getting out, I need some good ideas of things to make. Anyone have something? I don't have internet at home on my dev. computer, just a local LAMP server.
Thanks in advance!
Why do PHP regexes have the surrounding delimiters? It seems like it would be more clear if any pattern modifiers were passed in as a parameter to whatever function was being used.
How do you securely pass credit card information between pages in PHP? I am building an ecommerce application and I would like to have the users to go through the checkout like this:
Enter Information - Review - Finalize Order
Problem is that I am not sure on how to safely pass credit information from when the user inputs them to when I process it (at the Finalize Order step). I heard using sessions is insecure, even with encryption.
Any help would be appreciated!
I am looking for an easy to use CMS that can be used to host a multilingual website with photo galleries and few forms.
I am open to php/python excluding wordpress/joomla/drupal.
Hi everyone,
I was wondering whether it is possible to create a new database and user, from PHP, on an WHM/cPanel server.
Thanks in advance for your answers,
Constantin TOVISI
So, I finally got the PHP include function to work by tweaking the .htaccess file yesterday. The index shows up perfectly. But get this, I duplicate the index.html file, rename it and upload it as another page (as a template to work from) and now the PHP include function is not working on that page, even though it's exactly the same code hosted on the same server with the same .htaccess file.
Any idea what's going on?
Thank you,
Tara
I am using an image instead of a submit button for search option and use onclick events to load the results using ajax in php.Now I need to load results by hit enter also.Is their any ways to update my application without changing the image.
Thanks
Hi,
I am looking for an obfucator for my PHP code, the code which I am trying to obfucate uses the codeigniter framework. The obfuscators that I have tried, don't seem to be able to do it.
Any suggestions greatly appreciated!
Hi all,
I have to implement chat application to mywebsite using php.
Chat has the features like audio, video, and file transefer.
so please give reply for this,
Thanks,
What are the best resources do you recommend for learning php debugging?
Is there any specific book, screencast, blog post or article that you really found useful?
I am trying to convert a block of text that contains html text - i'd like to find all http links and convert them for link tracking purposes.
So eg anything like this in a string would be converted to the latter
<a href="http://www.google.com">Some Link</a>
<a href="http://www.mysite.com/tracking.php?url=www.google.com">Some Link</a>
Can anyone how to do this taking into account the original string will consists of all sorts of html, images etc..