Hello,
Does anyone know how to retrieve a piece of data and display the results in php file?
A similar query that I would enter is something like this:
SELECT 'email' FROM 'users' WHERE 'username' = 'bob'
Thus, the result would be just the email.
Thanks,
Kevin
...
Trying a bit of AJAX, and I find that much of my data is littered with underscores!
Documentation confirms that this is working as intended. Any way to pass my form information to PHP intact? I'm using CodeIgniter, so my pass looks like /controller/function/variable,
receiving controller:
controller{
function($v=0){#what once was he...
I can think of a number of ways to do this in PHP or even JavaScript, but I'm wondering if there's a SQL-based technique I'm overlooking.
I have a database table, let's say 20 fields X 10 rows. I want to display the entire table on an web page, so I'd do something like SELCT * FROM data_table;, and then format the result set using HTML...
I have seen some answers to this question in previous posts, but no one has given a real working example, just psuedo code. Has anyone ever done this before?
Basically, what i have is a variable in javascript (jquery), and i want to use this variable to drive a query (for an overlay window) i am going to run in php.
From what i have...
I have a custom Joomla component and a router for building my SEF URL's for use within the site, and everything is usually shiny - internally, all of my links look and act fantastic.
I recently route a controller action that sends a list of links through email, and I've noticed that my URLs are coming out.... funky - hopefully someone c...
Hi,
Is it possible to redirect a user to a php page and then redirect to different image, if the user is requesting for the image ?
For example if user requests for the image or if other website requests for the image, it should be redirected to the php page and then redirected to a different image.
Like if other website requests for ...
I have a row of IDs in a database that has been serialized.
What I'm trying to do is check those serialized IDs against a known ID to see if it should be excluded or not.
for example:
"SELECT * FROM mydb WHERE id = 4 AND checkID != 'an id in the serialized column' "
What's the best way to go about this?
...
Trying to format a date string using a technique I've used countless times, suddenly returning false (PHP5). Anyone run into this?
//$new_date = June 14,2010
echo $new_date;
$new_date = date("F j, Y", strtotime($new_date));
//returns the infamous December 31, 1969 because strototime() is returning false?
...
We have an internal control panel that all employees in the office are logged into all day, including customer service. I'd like for it to be setup so that it keeps you logged in for 1 hour before your session expires. How can I change this in the PHP.ini? I made a change before I understood would keep the session open until the brows...
I'm a pretty Huge n00b when it comes to Linux
exec ('whoami', $output, $return);
echo $return;
// Outputs 127
Which means the command is not executing. I can get it to execute when I root into the server.
Any help would be greatly appreciated!
...
I have this code i have been using....but i need a conditional where it will read all the sub directories of /bg to select an image as opposed to a specific folder if they were on a subpage.
Heres my code so far which works perfectly for all subpages to display specific images:
//This would tell us its on the homepage if it helps:
$thi...
Having a weird problem with PHPUnit. We're using PHPUnit as part of a continuous integration environment, that contains one app written using Zend Framework and one app written using CodeIgniter.
Unit tests run just fine under Zend Framework, but whenever I run the tests for CodeIgniter using fooStack's CIUnit bridge, I always get the ...
If I would like to have several static methods in my models so I can say User::get_registered_users() and have it do something like
public static function get_registered_users()
{
$sql = "SELECT * FROM `users` WHERE `is_registered` = 0";
$this->db->query($sql);
// etc...
}
Is it possible to access the $this->db object or c...
Ok, I'm trying to validate a form in codeigniter
as a first step I want to make all fields in my form required to make an entry...
but I can't make it work
here is the code:
myBlog.php
<?php
class MyBlog extends Controller{
function MyBlog(){
parent::Controller();
$this->load->helper('url'); //...
Is there still an injection risk when using prepared statements and mysqli_stmt_bind_param?
For example:
$malicious_input = 'bob"; drop table users';
mysqli_stmt_bind_param($stmt, 's', $malicious_input);
Behind the scenes does mysqli_stmt_bind_param pass this query string to mysql:
SET @username = "bob"; drop table users";
Or do...
i am running a mac with mamp and mamp pro. how do i check if i have apc enabled and if its not enabled or not installed how do i install it? thanks
i am trying to get the apc upload loader to work that i found online and it gets stuck on NAN% when im uploading.
this is a link: http://www.haughin.com/2007/10/23/php-upload-progress-with-...
So I've determined that my validator does not get called when I filter the input value and turn zero into null.
$this->addElement('select', 'State_ID', array('label' => 'State', 'multiOptions' => $this->getStates(), 'validators' => array($requiredBasedOnCountry), 'filters' => array($makeZeroNull)));
The reason I am doing this is beca...
I've developed a WordPress plugin and it wordked well from WP 2.0 and up to WP 3.0rc1 (haven't tried rc2) but now with rc3 and milestone 3.0 a strange and irritating error appeared.
If you check out my demo page you will se that none of the cover-images is working. they are in the same place as before but they can not be hotlinked or sh...
I have a result set of data that I want to write to an array in php. Here is my sample data:
**Name** **Abbrev**
Mike M
Tom T
Jim J
Using that data, I want to create an array in php that is of the following:
1|Mike|M
2|Tom|T
3|Jim|j
I tried array_push($values, 'name', 'abbreviation') [pseudo code], which gave me the ...
Hello,
I am trying to combine two integers in my application. By combine I mean stick one byte stream at the end of the other, not concatenate the strings.
The two integers are passed from hardware that can't pass a 32 bit value directly, but passes two consecutive 16-bit values separately.
Thanks,
...