<xml>
−
<item>
<userid>1</userid>
<username>example</username>
<useremail>[email protected]</useremail>
</item>
</xml>
hi all,im new to CI,just want to know how to change <item> to something else.maybe <user>
here is my model
if($query->num_rows()>0){
foreach($query->result()as $row){
$data[] = $row;
}
return $data;
}
thanks
...
Hi, I have this PHP piece of code that gets $_GET['id'] (a number) and do some stuff with this.
When its finished I need to increase that number ($_GET['id']) and redirect to the same page but with the new number (also using $_GET['id']).
I am doing something like this:
$ID = $_GET['id'];
// Some stuff here
// and then:
$newID = $ID...
I have a voting script which stores the post_id and the user_id in a table, to determine whether a particular user has already voted on a post and disallow them in the future.
To do that, I am doing the following 3 queries.
SELECT user_id, post_id from votes_table where postid=? AND user_id=?
If that returns no rows, then:
UPDATE po...
Hi,
I would like to create a picture in PHP with GD composed by different other pictures. For example I have 6 pictures (or more) and I would like to create ONE picture who contain these different pictures.
The Difficulty is that my final picture must have a fixed width and height (304x179), so if the different pictures are too big the...
I am thinking of using phplist to manage newsletter and other types of subscriptions. but i guess there is a limit applied by ISP on how much email i can send..
Any tips and tricks around how to use phplist and have a professional mass mailing software running
...
I use a basic setup which uses a layout.phtml for the HTML Layout and view scripts for the content part.
I want to control some variables in the layout in my controllers, i.e. the title of my site.
How can I access my layout to output variables from within the controller?
Thanks for your feedback!
...
Lets say I have a class like this:
Class User {
var $id
var $name;
}
And I run a query using PDO in php like so:
$stm = $db->prepare('select * from users where id = :id');
$r = $stm->execute(array(':id' => $id));
$user = $r->fetchObject('User');
If I vardump my user object it has all kinds of other fields in it that I have not ...
I have a PHP CLI script mostly written that functions as a chat server for chat clients to connect to (don't ask me why I'm doing it in PHP, thats another story haha).
My script utilizes the socket_select() function to hang execution until something happens on a socket, at which point it wakes up, processes the event, and waits until t...
I have a listing of names, that I want to store in mysql as a serialized array (for caching purposes). Some names contain apostrophes, and for some reason won't un-serliaze properly. There is no output.
...
I was think of learning Perl cause I hear around town its good for system admin things. Would it be possible to use it to automatically install a php script? I need to install a custom script on a few different server and wanted to know how I could make something in Perl to do it (like move scripts over to directory and stuff)?
...
I have a download folder.
So is it possible to redirect a user to a login page when he/she tries to download any of the files from the download folder.
I have heard this can be achieved using .htaaccess, but I can't find a good tutorial.
Thanks,
Searock.
...
I am using a jQuery notification system who runs when the user click on a link:
<a href="javascript:void(0);" onclick="$.n('This is a sample notification message, there are 3 more notification types which is all customizable through CSS.');">here</a>
But the thing is that i want to run $.n('This is a sample notification') not by press...
i try to execute cgi but failed.
i include following lines in .htaccess
AddHandler cgi-script .cgi
Options +ExecCGI
abc.com/ is equivalent to the /home directory
abc.com/compare is equivalent to the /home/compare directory
abc.com/compare/contact is equivalent to the /home/compare/contact directory
.htaccess file located in contac...
How to auto display php function parameter in vim ?
...
I have a site in ASP.NET and i thought it would be cool if i can redirect users to wiki.mysite.com. Now i would like to know if i can easily make MediaWiki recognize users logged into my site. I dont want any anonymous posters.
Is there a way to hook or have mediawiki use accounts/cookies from my site instead of using its own database/a...
I'm building an iPhone app, which will allow users to log in to a PHP web server that authenticates the user and starts a session.
My idea for managing a session is to create a singleton User class that has a sharedLogin method. Would it be prudent to store the session variable in the shared instance in order to maintain the session?
...
I'm just learning PHP, and I'm confused about what the purpose of the __construct() method?
If I can do this:
class Bear {
// define properties
public $name = 'Bill';
public $weight = 200;
// define methods
public function eat($units) {
echo $this->name." is eating ".$units." units of food... <br />";
...
I'm trying to create a "GetCurrentLevel" method that takes a point value as an input and returns what "Level" that corresponds to. I'm storing the Level => Points mapping in an array, but the array pointer is not moving logically when I use it a foreach loop. I've added echo statements for debugging. Here's my class definition:
class Le...
Hi,
I am storing images in mysql Db directly. what is the best way to display the image in good quality (thumbnail and original size images) using php.
...
Hi all,
it may be wrong place to ask this question, but i hope u all programmer must have the interesting naming convention of variables. i have seen many places that some variable names are very good n effective like
common variable names
$link
$db
$connect
$query
$stmt
$sql
$qry
$output
$result
$list
so please suggest me s...