I have a database containing two tables - one, states, contains info about each state's income taxes, and the second, brackets, contains the tax brackets for each state connected to States by a numeric key.
I would like to use SQL to retrieve each state and the AVERAGE tax bracket amount for each state to output in a recordset. For exam...
What happens if php.ini is missing? Does PHP load with a default configuration? In phpinfo(), it says the configuration file path is /etc, however it also says Loaded Configuration File (none). I went into /etc, and noticed there is no php.ini, only php.ini.default. PHP is working though, so I'm guessing it must load with default set...
<?php
(E_ALL & ~E_NOTICE);
session_start();
// is the one accessing this page logged in or not?
if (!isset($_SESSION['db_is_logged_in'])
|| $_SESSION['db_is_logged_in'] !== true) {
// not logged in, move to login page
header('Location: login.php');
exit;
}
else{
echo "Welcome To The Test Page:";
echo $_S...
I have an array of objects, containing lists of times. I have to stick this in a Matrix-alike array, in order to put it in a table. This is a part of my earlier SO question on how to build calendar tables
$node->sessions = array(
1286452800, // '2010-10-07 14:00:00'
1286460000, // '2010-10-07 16:00:00'
);
$node->title = 'Foo';
$node...
Firstly, sorry about the long question... but this is doing my head in. Any help would be greatfully accepted.
I've written the following function to return data from a mysql database:
function injuryTable()
{
# get all players that are injured and their injuires...
$sql = "SELECT players.id, players.injury_id, players.pname, i...
Hi fellows! I'll try to ask this correctly. This has got me licked.
I have a script online that will bring up items according to a search on let's say, page1.php. The results come from a table called items. The results list has links to the items that look like this: a href=\"/" . "boats/$name/" . "$p". $line["PID"]. ".html\"
In anothe...
Hi,
I have created a form that inserts the entered data into the database. It works perfectly except when I put SHA1('$password') into the INSERT INTO VALUSE tag. If I put only '$password it works fine.
Putting SHA1 displays - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the r...
I have to return data fetched from MySQL table into a php file as JSON. Here is my code to connect to mysql & get data from it. How could now I return it as JSON.
<?php
$username = "user";
$password = "********";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to...
I'm trying to determine if I should be using persistent connections or not. How can I track the overhead of establishing/closing mysql connections in PHP?
...
im trying to figure out how to find related topics items using mysql & php, this is my table for topics
topics{id, topic, founder,vote_up, vote_down date}
for instance say i was on topic page of php
topic {3,php,getaway, 6, 8, 20.06.2009 ect]
how would i find all the related topics to this topic:
if you get what i mean:)) thanks, ...
I am attempting to get a link to fire JQuery's .click() function so that I can call another script behind the scenes. All of the JQuery is generated dynamically by PHP.
The code looks correct, but the .click is not firing.
This is the code that generates the jquery:
$jscript = "$(\"".$server ."Restart\").click(function()
...
Hi Guys,
How come when I set 00 as a value like this:
$var = 00;
it ouputs as 0 when I use it? How can I set 00 so that $var++ would become 01?
...
Hi,
I am looping through an array, and for each value, I need to insert another array containing a few items. The below code inserts the array fine:
foreach($events as $Key => $val):
$schedule[$Key] = array(
array('event_id' => 'test',
'start_date_time' => 'test',
...
Hello. I'm currently trying work on a plugin and I'm running into an issue. Basically, in the plugin options page, I have a form in which the user will input information for an opt-in email. However, I need different forms for each instance of the email form. I'm trying to put this together quickly, so rather than rewrite it, I'm mer...
I have a simple modal dialog that I developed on my own linux server, running php 5.3. The script (shown below) runs fine on my server. However, I moved it to my client's linux server and instead of echoing the text/html that it apparently is supposed to do, it echos ALL the actual php code from the > (greater than) character on. Does...
I am having trouble designing a way to maintain a session with a cookie across multiple pages. I am doing something very similar to this tutorial. I check the password and username from a splash page, and if it is correct then I set a cookie and fill it with a hash. After that I transfer the user to a different page. If the username/...
Hi all,
I have a simple php code which prints data from a SQLite database.
Basically $query ="Select A from B".
This all works fine. & when the sqlite db updates, i can refresh the page & the new data displays.
Want i am aiming to achieve is to refresh this data automatically every 5-10 seconds without having to reload the entire page....
Hi Guys,
Say I have a string like John01Lima
is there any way to pull out the two numbers and have them as numbers that can be incremented with $number++ ?
...
Is working with Drupal + snippets of PHP for an extended period a likely career dead end for a Java developer? What positives can an industry newbie take from the experience? The SQL aspect of the job is not new, and the PHP required is only slightly more complex than copy and paste, so it's really only the CSS/Javascript stuff that is b...
Hello everyone,
I'm making a little widget for my site using a search api I just made. Briefly, I want to retrieve last posts or top rated posts. I've got to tabs for that.
By default, on loading, I'm on recent posts. If I click on Top posts, I'd like to call a function inside my plugin that modify a var that tell to my search API to r...