What is the best way to create member profiles in PHP? For instance, some websites read in the address bar: profile.php?id=11233 and then profile.php?id=13563. How is this actually done? As of now, I am saving such types of URL's in MySQL, but where will I write the actual code? Will I have to write the code in profile.php? Or will I hav...
Hi all,
I have a parent category that holds all Cars names, denoted by parent_name in table "parent". For each of these parents, there could be any number of car models & they all go in table called "model". Each of these models can have any number of images & refereced via the model_id as the Foreign Key. My task is to show all the Par...
imap_last_error() gives a string return in PHP when an error has occured.
I'd like to capture these so I can pass them to my app and act upon them. Problem is, it doesn't give a error code, additionally I can't find all the possible errors of which may appear.
Does anyone know where I can discover these? Currently I know
'Unknown Erro...
hi
I am looking for a way to change the value what I passed to function once a button is pressed
<span id="showHidden" style=" margin-left:726px; position:relative; top:40;">
<input type="image" id="btnShowHidden" src/images/hide.gif" onclick="showHiddenRecords(1);" />
</span>
As you see in showHiddenRecords, its ...
Hello, i have some scripts and in the database tabel i have set the dato to int(25) and timestamp
i have a create topic script and then i create a topic it insert the date and time in the timestamp tabel (dato).
but somehow my comment script will not insert the time :S and its the same stuff i use :S.
here is my script
if(isset($_PO...
I recently installed PDT Helios and now when using the debugger, it will break everytime a new class is referenced in the stack for all of Zend Framework classes. As far as I can tell, it is only done with ZF classes, and not my application's own classes.
If I have no breakpoints set, it will run continuously until completion but when I...
I would like to write a test using simpleTest that would fail if the method I'm testing results in a PHP E_NOTICE "undefined index : foo".
I tried expectError() and expectException() without success. The simpleTest webpage indicate that simpleTest isn't able to catch compile time PHP errors, but E_NOTICE seems to be a run time error.
I...
Im using FireFox's HTTP Live headers to view the headers.
I wrote a script at mydomain.com that just sets a test cookie.
I thought that when we send a request to a naked URL, http://mydomain.com/script.php, cookies are sent across to all sub-domains.
But when I sent a request to http://www.mydomain.com/script.php, the cookie wasnt sent i...
How do I form a multidimensional array using MySQL data? I'm using this code right now:
while($row = mysql_fetch_assoc($result)){
$music[$row['artist']][$row['title']][$row['id']][$row['category_id']] = $row['key'];
}
And I think it would be much easier to use a multi-dimensional array to store my data (artist array => title array...
ok so i have this array of about 151 elements and there is a date field as one of the elements. The array is a two week range. I want to count how many elements are in the first week and how any are in the second week. Here is my example array.
[0] => Array
(
[0] => 4d50
[date] => 07-10-2010
[telephone] => so...
I'm using a PHP graphing library from PEAR called Image_Graph to graph points of data in represented by bars. The graphs look fine when there's more than one datapoint, but when there's only one data point it looks like this:
http://img594.imageshack.us/img594/2944/screenshot20100715at528s.png
Has anyone else experienced this problem w...
OK, this is a tough one... I think, and I have a feeling the answer is simply no, but in that case I would like some answers for alternatives.
I have a very complex __autoload() function in a framework which can dynamically create classes. There a three classes required in order for the dynamic creation of a class called AuthActions --...
I have an array with tree data (by parent id). I want to convert it to multidimensional array. What is the best way to achieve that? Is there any short function for that?
Source array:
$source = array(
'0' => array(
'Menu' => array(
'id' => 45
'name' => 'Home'
...
Hello,
I am trying to use PHP to scrape some japanese text off a site and insert it in to a sqlite or MySQL DB.
The first problem I am running in to is actually getting the regex to pull the line of text I need from the site:
<h3><b>タイトル</b> : I_want_this_text</h3>
The text I want (I_want_this_text) is in japanese of course.
The...
Im fetching an array from my sql database, but the string has spaces in it (ie B54DT45 GDT4563 HaK7698).
This needs to go into a webadress like %30B54dT45%20 so that the outcome is
Here is my code:
$pid = mysql_query("SELECT cPushID FROM tblUsers WHERE intUserID='20' AND Length(cPushID) > 70 AND cAlerts = 'All'");
$url = rawurlencode(...
I'm mostly an OOP newbie, and am fiddling around in CodeIgniter building a very basic ORM (maybe for future usage - now mostly for learning).
At this point I have a large class called ORM which my models extend. So a widgets model will have methods like get() (which basically gets all the rows in the 'widgets' table), and get_with_relat...
so i have a date format like 07-09-10 and i want to know how to get ago from that date and if i can have a conditional like
if(is_date_with_1_week_of_above_date){
//do something
}
...
I just read this answer by Bill Karwin.
Note that the $node is pass by reference.
I always thought that variable created there is only ever temporary and exists only until the end of the loop (or maybe it remains set to the last iteration - I have not tested it).
So, what are the advantages of making it pass by reference?
I'm sure th...
I'm having a problem with my preg_match_all statement. It's been working perfectly as I've been typing out an article but all of a sudden after it passed a certain length is stopped working all together. Is this a known issue with the function that it just doesn't do anything after so many characters?
$number = preg_match_all("/(<!-- ([...
As far as I've done my searchings over Google and everything, it looks like this is a pretty common issue, but I cannot seem to fix it. Plus, I think that I have a little different usage of the function as others out there.
And, after about 3 hours of no luck, I'm posting here!
function free_result(){ ...