If I need to append data (not insert) into a particular super column, what should I do?
For eg:
Consider a existing record described below
Kespace : test
columFamily: testColum
SuperColumn : testSuper
column_name : email
value : [email protected]
Here if I want to add my phone number to the super column "testSuper". What should I do?
foreach($scraperSites as $site) {
//$scraperWriter->addSite( new ScraperSite($site) );
print_r($site);
}
scraperSites is the array of all sites from the mySQL database; I'm trying to keep $site as an array, (but only with one row worth of data), add it to an object, then move on to the next row.
hello guys..here i've a problem where i want to set the status whether it is approved or reject.. the condition are if admin select the registration number and driver name, that means the status is approve otherwise, if admin fill up the reason, that means the request is reject..
here is the code to set status
if ($reason =='null'){
$query2 = "UPDATE usage SET status ='APPROVED' WHERE '$bookingno'=bookingno";
$result2 = @mysql_query($query2);
}
elseif (($regno =='null')&&($d_name =='null')) {
$query3 = "UPDATE usage SET status ='REJECT' WHERE '$bookingno'=bookingno";
$result3 = @mysql_query($query3);
}
when i save the data, the status field are not updates..
Is there a way to crawl all facebook fan pages and collect some information? like for example crawling facebook fan pages and save their names, or how many fans, etc?
Or at least, do you have a hint of how this could be possibly done?
Hi
I have this code for example :
$b = "";
while ($row = mysql_fetch_array($rows)) {
if ($row['enabled'] == 1) {
$b = "checked";
} else {
$b = "":
}
echo "<\input name='nam[$row[id]]' type='checkbox' value='$row[id]' $b /";
}
When I execute this code, I will get a list of checkboxes, some of them are checked and others are not.
I can use this code to get a list of checked checkboxes.
if (isset($_POST['sub'])) { //check if form has been submitted or not
$nam = $_POST['nam'];
if (!empty($nam)) {
foreach($nam as $k=>$val){
// proccess operation with checked checkboxes
}
}
I need to know how I can get list of unckecked checkboxes after submitting the form.
Thanks in advance.
Is it possible for a web page using Javascript to get data from another website? In my case I want to get it for calculations and graphing a chart. But I'm not sure if this is possible or not due to security concerns. If it is considered a no no but there is a work around I would appreciate being told the work around. I don't want to have to gather this information on the server side if possible.
Any and all help is appreciated.
I'm generating plain simple links with CakePHP's HtmlHelper the following way:
$html->link("Newest", array(
'controller' => 'posts',
'action' => 'listView',
'page'=> 1,
'sort'=>'Question.created',
'direction'=>'desc',
));
Having the following route rule:
Router::connect('/foobar/*',array(
'controller' => 'posts',
'action' => 'listView'
));
The link is nicely generated as /foobar/page:1/sort:Question.created/direction:desc. Just as I want, it uses my URL prefix instead of controller/action names.
However, for some links I must add named parameters like this:
$html->link("Newest", array(
'controller' => 'posts',
'action' => 'listView',
'page'=> 1,
'sort'=>'Question.created',
'direction'=>'desc',
'namedParameter' => 'namedParameterValue'
));
The link in this case points to /posts/listView/page:1/sort:Question.created/direction:desc/namedParameter:namedParameterValue. But I do not want to have contoller/action names in my URL-s, why is Cake ignoring in this case my routers configuration?
I've just followed this example from Wordpress and I have successfully added an extra Meta Box in Post interface, and the value is stored in DB.
Now my question is, how can I retrieve and display the content of this meta box?
I'm trying the following code:
$intro = get_post_meta($post->ID, 'post_intro', true);
echo $intro;
But I get nada. What am I doing wrong?
And while I'm here, does anybody know if I can place this extra meta box above the default text box in Wordpress post page?
Hey all,
I have this SimpleXMLElement object with a XML setup similar to the following...
$xml <<< EOX
<books>
<book>
<name>ABCD</name>
</book>
</books>
EOX;
$sx = new SimpleXMLElement( $xml );
Now I have a class named Book that contains info. about each book. The same class can also spit out the book info. in XML format akin the the above (the nested block).. example,
$book = new Book( 'EFGH' );
$book->genXML();
... will generate
<book>
<name>EFGH</name>
</book>
Now I'm trying to figure out a way by which I can use this generated XML block and append as a child of so that now it looks like... for example..
// Non-existent member method. For illustration purposes only.
$sx->addXMLChild( $book->genXML() );
...XML tree now looks like:
<books>
<book>
<name>ABCD</name>
</book>
<book>
<name>EFGH</name>
</book>
</books>
From what documentation I have read on SimpleXMLElement, addChild() won't get this done for you as it doesn't support XML data as tag value.
Any ideas on how I should go about this ?
Thanks,
m^e
I'm going to do a new install of Wordpress. new 3.0 version is coming. current stable version is "WordPress 2.9.2" and "WordPress 3.0 Release Candidate" the last release before final version 3.
So for now i should setup 2.9.2 or 3.0 Release Candidate?
will i have to replace all files to RC upon final release?
What are cons to use Release Candidate version?
Title says it all. Here's the code:
<div id="regpage">
<form action="" method="post">
<fieldset style="border:none;">
<div class="label">Username:</div> <input type="text" name="username" class="item" value="" /><br />
<div class="caption">Must be 5-15 characters</div><br />
<div style="clear:both;"></div>
<div class="label">Password:</div> <input type="password" name="password" class="item" value="" /><br />
<div class="caption">Must be 6-20 characters</div><br />
<div style="clear:both;"></div>
<div class="label">Email:</div> <input type="text" name="email" class="item" value="" /><br />
<div class="caption">Valid email address is required</div><br />
<div style="clear:both;"></div>
<input name="terms" type="checkbox" id="terms" value="agree" /><div class="caption2"><label for="terms">I agree to the terms and conditions</label></div>
<p><input type="submit" name="register" value="Register" id="register" style="float:left;border:1px solid #999;background:#E4E4E4;margin-top:5px;" /></p><br />
</fieldset>
</form>
</div>
And the id "regpage" is definded in the style.css as:
#regpage {
width: 356px;
height: 150px;
color: #000000;
font-family: "Tahoma", Arial, Helvetica, sans-serif;
font-size: 13px;
}
If I move the checkbox OUT of it works just fine. But inside it will not interact in Mozilla. I've even tried adding onclick='this.checked="checked"' and it still does not interact. You can click until your blue in the face and nothing will happen.
What's the deal! This is REALLY driving me batty.
Hi
I have a data april/2010 to jan/2011
Is there any way to split the data with character to
and select the date as
The value before "to" as FROM
and The Value after "to" as TO
how to selet the splited value......... while i am selecting the data as it is as
select date from mytbl
how to select the date as two values
Hi,
I am using jaxl library for bot development on my debian server with openfire.
Now i want to apply pubsub functionality to it.
My scenario is : user subscribes to an event & when an event occurs message is sent to all the subscribers.
I am confused how to implement pubsub through im.
Please help
Thanks
I'm probably overlooking something really obvious here.
Comments are in to help explain any library specific code.
public function areCookiesEnabled() {
$random = 'cx67ds';
// set cookie
cookie::set('test_cookie', $random);
// try and get cookie, if not set to false
$testCookie = cookie::get('test_cookie', false);
$cookiesAppend = '?cookies=false';
// were we able to get the cookie equal ?
$cookiesEnabled = ($testCookie === $random);
// if $_GET['cookies'] === false , etc try and remove $_GET portion
if ($this->input->get('cookies', false) === 'false' AND $cookiesEnabled) {
url::redirect(str_replace($cookiesAppend, '', url::current())); // redirect
return false;
}
// all else fails, add a $_GET[]
if ( ! $cookiesEnabled) {
url::redirect(url::current().$cookiesAppend);
}
return $cookiesEnabled;
}
I have a simple setup of a set of writers and a set of readers working with a MySQL ISAM table. The writers are only inserting rows while the readers are only checking for new rows.
OK, so I know that I don't need a lock in this situation, since I'm not modifying existing rows. However my Writers are accessing one more table that does need a lock. I piece of information seems irrelevant except for the following limitation stated in the MySQL documentation:
A session that requires locks must
acquire all the locks that it needs in
a single LOCK TABLES statement. While
the locks thus obtained are held, the
session can access only the locked
tables. For example, in the following
sequence of statements, an error
occurs for the attempt to access t2
because it was not locked in the LOCK
TABLES statement:
So to access the table I want to insert rows into, I NEED to lock it, which is causing me performance problems. Any suggestions of how to get around this?
Hi,
I've an SQL database and I would like to do a query who show all the datas containing the sign "%". Normally, to find a character (for example: "z") in a database I use a query like this :
mysql_query("SELECT * FROM mytable WHERE tag LIKE '%z%'");
But here, I want to found the % character, but in SQL it's a joker so when I write:
mysql_query("SELECT * FROM mytable WHERE tag LIKE '%%%'");
It show me all my datas. So how to found the % character in my SQL datas ?
Thanks
You can use arrays with str_replace():
$array_from = array ('from1', 'from2');
$array_to = array ('to1', 'to2');
$text = str_replace ($array_from, $array_to, $text);
But what if you have associative array?
$array_from_to = array (
'from1' => 'to1';
'from2' => 'to2';
);
How can you use it with str_replace()?
Speed matters - array is big enough.
I need to connect to another database in Joomla! that's on another server. This is for a plugin and I need to pull some data from a table.
Now what I don't want is to use this database to run Joomla!, I already have Joomla! installed and running on its own database on its server but I want to connect to another database (ON TOP of the current one) to pull some data, then disconnect from that 3rd party database - all while keeping the original Joomla database connection in tact.
Hi,
i have just succesfully installed open atrium, but i can't find the configuration of the mailserver... i currently cant send any mails because there is no SMTP Server defined, an without mails being send, no new users can be registered, because they recieve their pasword via mail...
i hope that somebody can help me :)
Hai
I am having a form which contains a filetype like this
on submit i am calling a script
function addRowToTable()
{
var tbl = document.getElementById('uploadTab');
var lastrow = tbl.rows.length;
var iteration = lastrow;
var row = tbl.insertRow(lastrow);
var cell2 = row.insertCell(0);
var e2 = document.createElement('input');
e2.type = 'file';
e2.name = 'ufile[]';
e2.id = 'ufile[]';
e2.size='50';
cell2.appendChild(e2);
}
This script generates The tr on a button click... In my view generatedsource tool i get the "" like this
<tr><td><input size="50" id="ufile[]" name="ufile[]" type="file"></td></tr>
when i submit the form i dont get the file name for the generated file type in my view page
But i get the file name foe the one that is default
What may be the problem?