add values to array?
i've got an array with existing key/value-pair and i want to add values to the keys after the existing ones without deleting anything. how do i do that? ...
i've got an array with existing key/value-pair and i want to add values to the keys after the existing ones without deleting anything. how do i do that? ...
Im handling various email addresses that come in the following forms John Doe <[email protected]> [email protected] How could i use regex, to find the @ symbol, and then return the integer's behind it (until it doesnt find anymore, or runs into a non number, < or space for example.) ...
Hello, Im having trouble getting a function within a function working, do you think what I have below is done rigth? Im not getting the expected results, if you could shed some light on functions within functions i would appriciete it. thanks function test1 () { global x; $x=123; function test2() { echo $x; ...
I've got an array like this one: arrayname[1] = "jacob"; arrayname[2] = "peter"; arrayname[3] = "jacob"; arrayname[4] = "nicholas"; I want to remove the double jacob so it will be like arrayname[1] = "jacob"; arrayname[2] = "peter"; arrayname[3] = "nicholas"; How do I do that? ...
I'd like to get the HTML for a MediaWiki Page, that is I want to run the MediaWiki Markup through the parser. Now, I know I could just use some external Parser, but most of them do not support Transclusion and (naturally) Extensions, so my output will be different. As I have access to the MediaWiki installation, I wonder if I can just u...
this is very tricky. i´ve got a table with 2 columns thread_tag_map: thread_id and tag_name. thread_id tag_name 1 football 1 manchester 2 manchester 2 england 3 england 3 queen 4 queen 4 diana as you can see one thread can have multiple tags, and this gi...
I have a PHP form, with various input fields and textboxes. If you submit and go back, all of the data that was submitted in the input fields remains, however the textboxes are blank. How can I get the data entered in the textbox to cache like the regular text inputs? ...
I have written a simple program to generate rss feed from mysql db. but it broke because of the reason that there were several characters in the data which were special like '&' which made RSS feed go bad. I am sure there would be some easy to use library which would take care of these things and I dont have to find replace such data( w...
How do I insert two rows into two different tables. I can't seem to get this right? Here is the code below. // tag is not there, so insert a new instance $mysqli = new mysqli("localhost", "root", "", "sitename"); $clean_url = mysqli_real_escape_string($mysqli, $page); $dbc = mysqli_query($mysqli,"INSERT INTO q_tags (tag_id, users...
Hi guys, I need a quick look at my SQL query. It's already given me a headache. Comparing some advice I have gotten, I could not figure out the proper format for my SQL. This is my code: $query = "INSERT INTO `[my_db_name]`.`members` (`id` ,`first` ,`last` ,`add1` ,`add2` ,`phone_home` ,`phone_cell` ,`phone_dad` ,`phone_mom` ,`email1` ...
I have a question I'm trying to have the q_id column take the value of the id column when a tag is submitted I have been trying to do this using PHP but I was thinking should I just add AUTO INCREMENT to the q_id column since but tables are updated when the tag is submited. or is this the wrong way to do it or is there a better way to do...
Any suggestions for simple voice chat solution for a PHP based website. We already have a text chat in place, client now wants voice chat too. ...
I am trying to write a class that can parse an iCalendar file and am hitting some brick walls. Each line can be in the format: PARAMETER[;PARAM_PROPERTY..]:VALUE[,VALUE2..] It's pretty easy to parse with either a bunch of splits or regex's until you find out that values can have backticked commas, also they can be double quote marked ...
This: <!----> This little S.O.B, right there. 7 characters of evil, forcing IE to render all pages with it at the top like this in quirks mode: <!----><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> If it's not evil I don't know what is because it certainly isn't in themes\default\overall.php, because the fir...
Given some unknown input, how do you tell which variables are being substituted into a (s)printf statement? printf("%s %s", "a", "b"); // both used printf("%s", "a", "b"); // only the first one used printf('%1$s %1$s', "a", "b"); // " " printf('%s %1$s', "a", "b"); // " " printf('%1$s %s %1$s', "a", ...
Is it possible to convert a PHP file to binary and deploy it on a webserver.......... ...
Sorry for the title....In PHP I use the date('w',mydate) to get the week and then I got the week of the date.If user clik next week it increments the current week by one. For example date('w',2009-12-10 05:00:00) it returns week as 50.if i click next week button iincrement as 51 and display the dates.at the end of 53 eeks also it takes ...
I can update almost everything in both my mysql tables when somebody enters a tag I just don't know how to add the tags tables id value to the q_tags tables tag_id value which will be the same when the user enters the tag. I hope I explained this okay. Can someone please help me. Here is the MySQL tables below. CREATE TABLE q_tags ( ...
Quick question, again, I'm sure this is ridiculously simple but I don't see what I'm doing wrong! while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<a href=\"http://mysite.com/{$row['row1']}/{$row['row2']} \">{$row['row3']} </a>"; } This produces all my links to be stacked up one after the other. I want to order them in...
iam making a json object by the following query $arr = array(); $qs=qq("select main_cat_id,main_cat_name,id,name,cat_id,cat_id_main from main,scheme where main_cat_name='xyz' and cat_id_main=main_cat_id"); while($obj = mysql_fetch_object($qs)) { $arr[] = $obj; } $total=sizeof($arr)...