What is the best way to produce a report listing the fieldname and then the
data in that field. It is a report containing only one row from a table, but
I don't want to hard code the fields since they change often.
I can get the field names dynamically like this:
$fields = mysql_list_fields("Netw
ot;\n", $StockResults);
foreach($Rows as $Row) {
list($Symbol, $Price) = split(",", $Row);
$Symbol = str_replace('"', "", $Symbol);
echo $Symbol." - ".$Price."\n";
$TickerData = array ($Symbol => $Price);
}
print_r($TickerDa
t;", $Symbol);
$TickerData = array("$Symbol"=>"$Ticker");
}
print_r($TickerData);
echo $TickerData["IKN"]."\n";
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tuesday 03 February 2004 00:1
I have never had this problem before and it is probably something simple...
Please take a look at the two foreach statements. I am at a loss as to why
the second line does not actually remove the quotes. The first foreach
statement does so how are they different.
$StockURL =
"http://finance.yaho
Ok the problem seems to me, the format. I think that once I have the format
changed to include a comma seperation for thousands. I think at that point,
it is no longer a true number, so PHP deals with it differently.
"Christopher J. Crane" <[EMAIL PROTECTED]> wrote in message
news:
.
"Stuart" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Christopher J. Crane wrote:
> > This does not ...
> > $SummaryResults = mysql_query("SELECT * FROM Accounting WHERE
> > UserID='$UserID' LIMIT 1") or die("Invalid qu
g WHERE
UserID='$UserID' LIMIT 1") or die("Invalid query");
while($SummaryField = mysql_fetch_array($SummaryResults)) {
$Balance = number_format($SummaryField["Balance"],2,'.',',');
}
if($Balance >= 10001) { echo "\$$Balance\n";
I do a lot of this.
Go to http://designpile.net/stocks
I use a file called charts.php as the image file..so like
http://designpile.net/stocks/images/lchart.php?sym=IKN
This way you can pass varibles to the php code. As you might have guessed
this is not an image but instead a PHP code creating the
I have these lines of code, that I thought was simple enough, but it doesn't
work how I thought.
The Variable $Balance is set to 1 in the database, and I thought it
would be outputed as purple or the be found true of the "else" part of the
code. It comes out as red or the "elseif" part of the c
That worked.
Thanks Robert.
"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 2003-12-16 at 15:02, Christopher J. Crane wrote:
> > I am using Pdf-Php to create pdf docs. I have a long text line that
wraps
> > automatically whe
I am using Pdf-Php to create pdf docs. I have a long text line that wraps
automatically when outputted in the pdf. That is what it is suppose to do,
however, it also outputs the new lines of the text in the source of the php
file. That is not what I want. So I do a string replace for the "\n" and
r
I checked the field properties and it is set as large text or memo, and the
data is complete in the field, just when I try to fetch it, it comes back
truncated somehow.
"Christophe Chisogne" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Christopher J. Crane w
Please Help!
I am using PHP to pull data from a MS SQL database. All other fields are
returning data fine, but this one table PROFILE is returning only like some
of the data in the field.
I am using the following simplified code:
MSSQL_CONNECT($HostName,$UserName,$Password);
mssql_select_
I can not get a variable in a session to unset() and then re-populate and it
is destroyed. Please follow below to get the flow of what I am doing.
I have created a helpdesk application with a login. I am using sessions to
keep track of information I need for the session.
That information is
User'
Is this the best way to do this?
if(isset($Task) && $Task == "Add") { Do something }
I want to check if the variable is set and if so, if it is "Add".
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have created a helpdesk application with a login. I am using sessions to
keep track of information I need for the session.
That information is
User's ID
User's Last Name
User's First Name
If the User is Authenticated
and the type user they are.
Here is the page the form goes to after submitting
echo "\$month: ".date(F,strtotime($month))."";
you have escaped the $ by placing the \ in front of it. Remove it.
"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> could someone tell me why this:
>
> $month = date(m);
>echo "\$month: ".date(F,strtotime($month))."
If PHP is install the GD modules are already there.
Write a should script and put it on your server and
access it through your web browser. It will tell you if GD is installed and
what version. I do a lot of work with these and would be willing to help you
get started.
By the way, most people her
I have a script that loads 13 or more file names into an array. Then at
random I select one of the names out of the array. This files are background
songs used on my webpage. Streaming a different song each time the page is
refreshed or loaded. My issue is I do not want the same song to ever be
pla
JPGRAPH is the best I have found so far. Good documentation and great
results. I use it for a lot of graphing purposes, the most being stock
market charts and graphs.
"Joseph Szobody" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Dennis,
Try this:
http://www.aditus.nu/jpgraph/
Jose
I am just getting into PDF creation and I am having some issues. Can anyone
send me a simple script that creates a PDF doc. I would like it to open in
the browser after creation, not create a file. If someone has a simple one
with an image placement as well that would be great. I can figure it out
I have a CSV file that has 7 fields. One of the fields has a number, and
some of the numbers start with a "S". If that number start with a "S", I
want to strip it off. I am not sure how to do that. I first wrote the script
to open the file, load each line into an array and split the array by field.
will not create a $field["Name"].
>
> So, if using :
> $field=mysql_fetch_array($resource, MYSQL_ASSOC)
> if(empty($field["Name"])) { do this }
> else { do this }
>
> OR
> $field=mysql_fetch_array($resource)
> if(!isset($field["Name"])) { do
How do I check if a variable is blank or not. I am returning data from a
MySQL database and if a field is empty I would like to do something
different.
I tried
if($field["Name"] == "") { do this }
else { do this }
It does not work right. Actually, at one point, it was working in the exact
opposit
I use a website to get data that I would like with the following code:
function StockLookup($company) {
$LookupUrl = "http://quote.yahoo.com/l?s=$company";;
$Results = implode('', file("$LookupUrl"));
list($split1, $split2) = split('', $Results);
list($Final, $split3) = split('',
$split2);
pr
d to
seconds))) * 8)) / 1000 = kbits per hour
$kbitsout = ((($OctetsOutB - $OctetsOutA) / ($TimeB - $TimeA)) * 8 ) /
1000;
print "$kbitsout Kbits - $LineCount\n";
$LineCount++;
}
"Christopher J. Crane" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news
$unix_time_1 = $unix_time_1;
> etc
>
>
> On Mon, 2003-01-06 at 15:51, Christopher J. Crane wrote:
> > Ok, this is the first time I will post a message without a line of code.
I
> > am not sure how to go about this task. So I will describe it and maybe
> > someone will hav
Ok, this is the first time I will post a message without a line of code. I
am not sure how to go about this task. So I will describe it and maybe
someone will have some thoughts.
I use PHP to connect to our many routers and get data using snmp. I have
written a script that refreshes itself every 1
}
closedir($handle);
}
?>
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> you must prepend $DirToCheck to $file:
>
> filemtime($DirToCheck . $file)
>
>
>
> Christopher J. Crane wrote:
>
[EMAIL PROTECTED]...
> you must prepend $DirToCheck to $file:
>
> filemtime($DirToCheck . $file)
>
>
>
> Christopher J. Crane wrote:
>
> >I am trying to parse through a directory and get the modification dates
of
> >the file.
> >
> > >$DirToCheck = &quo
I am trying to parse through a directory and get the modification dates of
the file.
\n";
}
closedir($handle);
}
?>
All the files are coming back with a date of December 31 1969 19:00:00. What
am I doing wrong? The next step is I want to check if the file is older than
30 minutes and if
I have two periods in time from a Cisco router that I would like to find the
difference in seconds. I am not sure the best way to do this since it is not
a date, but rather an amount of time since last reset.
Here is the numbers
181 days, 7:11:06.66
//stands for 181 days, 7 hours, 11 minutes, 6.6
Oh man...it's always the simple things you over look...thank you.
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thursday 05 December 2002 04:08, Christopher J. Crane wrote:
> > This is the output I get a
age = 78ms
"Christopher J. Crane" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to get a script to work. The basic idea is to go into a
databas
I am trying to get a script to work. The basic idea is to go into a database
and grab some IP addresses for my LAN. Then for each one ping it using the
exec command 1 time. If it is successful print output in green and if it is
not, print output in red. This is being done on a Win32 system. The pin
I didn't do it yet.
The script I am working on is large with many variables so I was hoping
someone else would know before I do it.
"Chris Hewitt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Christopher J. Crane wrote:
>
Can you global a variable at the same time as making it an array?
I usually do this:
$Ticker = array(); global $Ticker;
Can I do this?
global $Ticker=array();
Thank you.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I am having problems with arrays. I guess I just don't understand them all
that well.
I have an simple array of stock tickers. Then for each ticker I go to Yahoo
to get their current price and try to push the Name of the ticker and it's
value into an associative array(I think). Then I want to sort
t and last elements.
>
> On Wed, 2 Oct 2002, Christopher J. Crane wrote:
>
> > I am looking for a way to find the highest 5 and lowest 5 numbers within
300
> > or so numbers. Here is what I have so far...
> >
> > $Tickers = array();
> > $Current = array();
>
I am looking for a way to find the highest 5 and lowest 5 numbers within 300
or so numbers. Here is what I have so far...
$Tickers = array();
$Current = array();
// SQL QUERY TO GET TICKERS
MSSQL_CONNECT($HostName,$UserName,$Password);
mssql_select_db($DBName) or DIE("Table unavailable");
$Something = str_replace("\n", "", $Something);
This is old but still works well.
"Andre Dubuc" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Perhaps I don't understand the use of 'htmlentities' too well, but I would
> like newlines to be retained/inserted int
...
> Hello,
>
> ...just wondering...
>
> Are you sure VARCHAR in MS SQL can handle 5000? Should be 255 only? (I'm
not
> really familiar with MS SQL but you can count the number of characters
> returned by php...)
>
> - E
>
>
> "Christopher J. Crane" <
On thing you could do is output tags around the text you want to
display. The <> tags keeps simple formatting like tabs and new line
characters.
"Shane" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Greetings folks.
I need my carriage returns to show up in my H
I wrote a simple script to return data from a query. The database is MS SQL
and the field I am looking to return is a VARCHAR(5000). Everything seems to
work except the data returned is not the whole field it is shortened. It
only returns a portion of the field.
Here is the field:
99 Services, In
I am trying to get a script to work to retrieve data from a MS SQL database.
I also tried using a ODBC connection, but that didn't work either.
Here is the error I get;
Warning: MS SQL: Unable to connect to server: LocalServer in
C:\WEBS\CTTechCouncil\stocks\mssql.php on line 7
DATA
Does anyone know of a Javascript forum like this one that I can post a
question to?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
That's what I thought it meant but I have never seen it writte nthat way.
Thank you very much
- Original Message -
From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
To: "Christopher J. Crane" <[EMAIL PROTECTED]>
Cc: "Mike richardson" <[EMAI
Thanks. I will give it a shot. I have never seen anything written like that.
Can you give me a brief explanation of what it means?
Thanks again.
- Original Message -
From: "Mike richardson" <[EMAIL PROTECTED]>
To: "'Christopher J. Crane'" <[EMAIL P
How do you alternate colors of the rows in a table inside a while statement
when dealing with the output of data from a DB. I am sure it's something
simple but I keep getting into some really long math thing...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www
cedant web hosing...cedant.com. They will bill you and you can pay by check
and with Mysql databse I think they are 12.00
"Bruce Karstedt" <[EMAIL PROTECTED]> wrote in message
003b01c24e2b$7a9c9e80$7772d73f@c3">news:003b01c24e2b$7a9c9e80$7772d73f@c3...
> Anyone care to recommend a host as follows:
This is a little off topic, but I am desperate. I am looking for a good
PHP/MySQL chat that is not in a bunch of frames. I have from WebChat
(http://www.webdev.ro/) but it has a bunch of runtime erros. If anyone has
this working or they know of another that works well please send me a link
or some
your script in a *nix platform?
>
> -- Joni
> --
> // Joni Järvinen
> // [EMAIL PROTECTED]
> // http://www.reactorbox.org/~wandu
>
> "Christopher J. Crane" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I
file://==Global Definitions
file://
define('SCRIPT_NAME', 'Connecticut Technology Council Directory Maker');
define('SCRIPT_VERSION', 'v1.0');
define('SCRIPT_CREATOR', 'mailto:[EMAIL PROTECTED]";>Christopher
J. Crane
file://==Global Definitions
file://
define('SCRIPT_NAME', 'Connecticut Technology Council Directory Maker');
define('SCRIPT_VERSION', 'v1.0');
define('SCRIPT_CREATOR', 'mailto:[EMAIL PROTECTED]";>Christopher
J. Crane
Just so you don't feel alone.
I use jpgraph alot, however, I have not run into this problem.
What version of jpgraph are you suning.
"Lee P. Reilly" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Anybody out there using JpGraph? I directed the following questio
file://==Global Definitions
file://
define('SCRIPT_NAME', 'Connecticut Technology Council Directory Maker');
define('SCRIPT_VERSION', 'v1.0');
define('SCRIPT_CREATOR', 'mailto:[EMAIL PROTECTED]";>Christopher
J. Crane
place.
*/
//==Global Definitions
//
define('SCRIPT_NAME', 'Connecticut Technology Council Directory Maker');
define('SCRIPT_VERSION', 'v1.0');
define('SCRIPT_CREATOR', 'mailto:[EMAIL PROTECTED]";>Christopher
J. Crane');
define(
inal Message -----
> From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
> To: "Christopher J. Crane" <[EMAIL PROTECTED]>; "Andrey Hristov"
> <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, July 29, 2002 7:12 PM
> Subject:
to someone in fear of someone like you who thinks they are better
then everyone else. The name of this list is not "EXPERTS" or "Only after
you tried several times" it is general.
- Original Message -
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
very nice... thank you!
- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Christopher J. Crane" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 12:04 PM
Subject: Re: [PHP] Dates and Date()
> Use while
Ok here is what I did.
$Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
Now I am wondering if there is a way to look for only the last day business
days and be returned in an array?
- Original Message -
From: "Andrey Hristov" <[EMAIL PROT
I believethisto be one way to find out yesterday's date:
$tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y"));
However, I would like to have a snippet of code to tell me how to get the
date of today - 10 days ago.
if today is jul 29, 2002, how do I get the date funtion to tell me 10 day
Thank you for your 2 cents I am just learning and appreciate your comments.
- Original Message -
From: "Michael Hall" <[EMAIL PROTECTED]>
To: "Chris Crane" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 11:13 PM
Subject: Re: [PHP] Classes vs. Functions
>
> There
I think this is whenever I would like to display a variable I have to
put
> in
> > a script tag like . I might have as many as 20
> of
> > these on a page. Every time doesn't PHP have to start again and parse
out
> > this information causing it to be really slow?
> &g
I have gotten JPGraph to work if I suppress the output of errors. I am using
the example of backgroundex02.php.
If I add the line "error_reporting(0);" at the top, I get the graph, if I
remove it...I get the following error;
"
Warning: Use of undefined constant LC_TIME - assumed 'LC_TIME' in
../j
$Tags['issue-name']. So I could print it out. Something like, print
"$Tags['issue-name']\n";
I was able to get a numerical representation of the array like, $Tags[5] and
the value of that tag was "RED HAT", but then I would have to know what the
position of the data I am looking for in the array.
Here is a piece of code, that is close to doing what I want it to.
The end result I would like to have is an array that is simple to work with.
If the XML tag was RED HAT, I would like something
like the following:
$Tags['issue-name']. So I could print it out. Something like, print
"$Tags['issue-
Another site that you should be aware of is for both internal and external,
NASA uses PHP and MySQL, of which both are free.
"John Christopher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I would like to use PHP in a project for a United States
> Governmen
Here is a piece of code, that is close to doing what I want it to.
The end result I would like to have is an array that is simple to work with.
If the XML tag was RED HAT, I would like something
like the following:
$Tags['issue-name']. So I could print it out. Something like, print
"$Tags['issue-
I like this piece of code. In fact, I convert all my scripts that use the
older If/Else code. What would happen if the "break; " wasn't used. Would
it just continue through the rest of the function to find another match???
"Miguel Cruz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">new
still
errors.
>
> In Perl, it would simply be ignored. What do I do here.
>
> Here is a simple example of the code.
>
> if ($Task == "ShowVersion") { function ShowVersion(); }
> elseif ($Task == "GetData") { function GetData(); print "$DataOutput"; }
> elseif ($Task == "CreateImage") { function CreateImage(); }
> else { print "Incorrect Variable or no Variable Supplies"; }
>
>
>
>
>
> Christopher J. Crane
> Network Operations Manager
>
> IKON Office Solutions
> 860.659.6464
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ou'd have to put it as the
> first line inside the CharacterHandler function.
>
>
> > print "1st Position in the array = $StockStuff[1]\n";
> ... snip ...
> > Christopher J. Crane
> > Network Operations Manager
> > IKON Office Solutions
>
>
Ok time out...the problem was simple I had each of the functions one it's
own line because it was simple to see. When I add code to the functions then
I do make it as indicated and easier to read. The problem was that I did not
realize the 80 character columns width. I apologize but did not think
t_line_number($xml_parser)));
}
print "";
xml_parser_free($xml_parser);
print "Array = $StockStuff[0]\n";
and I got an error that read "XML error: at line 67". I am not sure what
that meant.
"Analysis & Solutions" <[EMAIL PROTECTED]> wro
I am new to using XML and PHP for that matter. I have made some great
progress with the latter however.
My current problem is that I am trying to parse a relatively simple XML
file. The file can be found at
http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=ikn. I used
pieces of a sampl
I just downloaded the new version of PHP. I installed it and I am using
Omnicron HTTPD server version 2.09. The PHP that came with the server works,
but when I installed the new version of PHP from PHP.NET, I got the
following error.
I just downloaded PHP from PHP.net and it's the newest version.
I can not get it to work. I get the "Security Alert! PHP CGI cannot be
accessed directly" message.
I have edited the php.ini file and changed the "cgi.force_redirect" to "0"
and back to "1" and everything else I could think of. I rest
I wrote a shopping cart, but I
don't understand two things.
1) What is the best way to display like the first ten records and then a
list of how many pages with 10 records on them...similar to like a search
engine when it returns it's results. If I have 100 items I do not want to
display all of th
I am a PERL scripter and I am just getting into PHP. My first few pages are
simple but I am running into a few problems when changing OS. I included
below a piece of code that works fine in windows but not on a linux box. Not
sure what the differences would be
The problem is that on the windo
79 matches
Mail list logo