There is any way to get the tables I'm using in a query?
The first method I was using was with regular expressions:
// result[1] = "SELECT"
// result[3] = "All between FROM and WHERE, ex: `users`, ex: `users`, `test`
if($result[1] == "SELECT" && !preg_match('/FROM\s*(.*?,.*?)\s*WHERE/i', $query, $res))
{
$tables = preg_replace('/`...
I need to develop an application which requires integration with credit card payment gateway and hence for testing i need a free developer account or any other possible account so that i can check whether the payment processing is correct or not.
So please specify me, if there exist some payment gateway that allows the creation of a fr...
Hello.
Giving a starting date, I'm adding four times seven days to get 5 different dates separated exactly a week each one.
//$date = '28-10-2010';
$timestamp = mktime( 0, 0, 0, 10, 01, 2010 );
echo "Date=".date( 'd-m-Y', $timestamp )."<br>";
$timestamp += (60*60*24*7);
echo "Date=".date( 'd-m-Y', $timestamp )."<br>";
$timestamp += (6...
How can i create a XML editor with easy to use interface using php
...
Well guys i've been struggling with this for about 5 hours now and i realise my brain is fried thought i better get some people who know what they are doing :p Now i just have to explain the problem properly.
I want to display all the goal scorers with just their name and goal time for each separate goal after it like:
Carlton Dickson ...
I am using a hook form alter to override the registration process. I want to assign a custom role that i have defined to the new user. How do i get about doing that?
I see that there is a users_roles table. Would simply making an entry in it with the user id and role id do the trick?
Thanks
...
I use the following pattern:
http://example/index.php?lang=en
http://example/index.php?lang=es
http://example/index.php?lang=zh-tw
http://example/index.php?lang=zh-cn
And I use the following mod_write rule:
RewriteEngine on
RewriteRule ^([a-z]{2}(-[A-Z]{2})?)/(.*) $3?lang=$1 [L,QSA]
With that rule I can use the following URLs which...
For example I have a role called "teachers". For any user that belongs to that role, I want to be able to display a custom profile that is different then the main one. I read at some place that one can make a tpl file in the pages folder of the theme and some how it could be made to show for specific roles or URL path.
Would anyone care...
I m trying to make a form in Drupal where one of the dropdowns shows values depending on another one. In my case where I m making a form for some student program, I need to ensure that the options available for 'areas of interest' depend on the 'department' the user selects. Can anyone suggest a way to do this. Anyways, I was using 'webf...
Hi, I have the following function in a .js file in index.html
function getValues(){
$.ajax({
type: 'POST',
url: "http://localhost/getData/getdata.php",
success: function(data){
var dataValues;
var apnd;
dataValues = String(data.NSE);
apnd = "a";
updateValues(dataValues, apnd);
dataValues = Stri...
I am a techie with expertise in Java and C++. I have no knowledge of web technologies. I want to create a new website and for this, I want to learn web development using PHP.
I did some research online and came across recommendations that suggest using multiple books to learn the same - "Head First Php & MySql" , "Learning PHP, MySql a...
Hi.
I want ny users to give ny app "manage_pages" extended pemission but i want my users to be able to select which of their pages they give permission to.
I have this code which is responsible to autenticate and get the users permissions:
$('#btn-connect-facebook').click(function(){
FB.login(function(response) {
if (respo...
CONTEXT:
My project is a CMS website, and each user's CSS is held in a database table. Fields are:
int id primary
int site_id index
string selector
string property
string value
bool important
When a user's website is pulled up, it's a simple query:
SELECT * FROM css_table WHERE site_id = $this_site_id
...
This is my view all function in my postcards model, in one controller it returns 4 and the other returns, no idea why, I'm echoing num_rows() to see whats going on.
Theres nothing else being passed, its exactly the same except, one view is a front for a facebook and one view is an admin section
function view_all(){
$query = $this-...
I would like to be able to pull back 15 or so records from a database. I've seen that using WHERE id = rand() can cause performance issues as my database gets larger. All solutions I've seen are geared towards selecting a single random record. I would like to get multiples.
Does anyone know of an efficient way to do this for large datab...
Hey guys,
Just a quick question (maybe not)
I'm looking to add to my website a way for a customer to login and once logged in they are able to select their invoices which i will upload to my server.
My question is what is the best way to go about storing the files and accessing them.
i've done some googling and haven't been able to f...
I want my users to activate their accounts before they are able to login. They are sent an email after registration containing an activation link, something like this:
http://www.blabla.com/[email protected]&token=Aisd23uNMAu53932asdDasd82AS
Of course, whenever someone logs in, I have to check wether or not that ...
My mate and I are designing/implementing a web based media application. It will provide media management and distribution abilities.
Long story short, as much as we want a web based GUI for users to be able to perform site functionality (CRUD) and also have an administration area to control various aspects of users there is another c...
I have a table with a name and type field. The type field contain the musical taste of the person in this way:
"Rock; Pop; Metal; Dance" (varchar)
I need to generate an excel list with this persons grouped by music taste.
For example:
One list with everybody in Rock; Metal; Dance
Another with everybody in Rock; Metal; Trance
Another...
I remember running some tests a some months ago with gettext and the following code worked perfectly:
putenv('LANG=l33t');
putenv('LANGUAGE=l33t');
putenv('LC_MESSAGES=l33t');
if (defined('LC_MESSAGES')) // available if PHP was compiled with libintl
{
setlocale(LC_MESSAGES, 'l33t');
}
else
{
setlocale(LC_ALL, 'l33t');
}
bindt...