[PHP] Need Coding Help With getdate()

2003-01-24 Thread Guru Geek
Hello,

I'm trying to use getdate() and then create a numeric value based on
putting the month (numeric), the date, and the year all together, side
by side in one variable.

Here's my code:


But all I get is a blank when I look at $date in the browser.  Any idea
why that is?

Thanks in advance,
Roger



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Designing My First Content Management System

2003-01-24 Thread Guru Geek
Hello,

I've decided that for my first real PHP project I'm going to create a
Content Management System that is PHP based.  I was wondering if anyone
out there had any thoughts, idea's or suggestions before I get started?
Does anyone out there have any working examples of a PHP based CMS?

Thanks,
Roger



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Adjusting Indexed Field After Deleting Entry

2003-01-25 Thread Guru Geek
Hello,

Here is one of my smaller PHP projects.  I'm trying to finish it before
I move on to my CMS project.

 http://www.g-i-w-s.com/linker_admin.php

The script does nothing more then manage links.  It lists an indexed
number of the link, a url, a text description and a delete option.
Here's my question.  I originally had a link #1, #2, and #3.  I
obviously deleted them.  I was wondering if there is a way to use
PHP/MySQL to get the indexed numbers to re-assign so that the first link
you see is always #1 the second link you see is always #2 and so on?

Thanks in advance,
Roger

PS
The original script was not mine, it came from a 'php how to' article at
web monkey, I did some modifications to fit what I needed.  We don't
want anyone thinking that I'm taking credit for their knowledge  ;-)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] output of fread() is blank

2003-01-27 Thread Guru Geek
Hello,

I'm a recent convert from CGI/Perl and so am still getting my feet wet
in PHP.

Here's my code:
$filename = "http://www.myserver.com/include/sometext.txt";;
$handle = fopen ($filename, "rb");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
exit;

The problem is nothing shows up, it's a blank browser window.  I'm sure
this is a stupid questions and very easily fixed.

Also, if the text file I'm trying to read is multi lined, shouldnt I be
placing the contents into an array?  or is that old cgi habits coming
through?

Thanks,
Roger



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] output of fread() is blank - FIXED

2003-01-27 Thread Guru Geek
Here's my code now:

$filename =
"/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo readfile($filename);
exit;

now it displays the contents of the text.txt file.  I originally had just
/include/text.txt but it told me no such file existed.  But once I added the
root directory stuff in front of that, it works.

I'm having a similar problem getting smarty to run, it keeps telling me that
it can't find index.tpl and now I think I know what the problem is...

Thanks to everyone



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] output of fread() is blank - FIXED - updated

2003-01-27 Thread Guru Geek
Sorry, here is the code now ( I need a nap )

$filename
="/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
exit;



Guru Geek wrote:

> Here's my code now:
>
> $filename =
> "/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
> $handle = fopen ($filename, "r");
> $contents = fread ($handle, filesize ($filename));
> fclose ($handle);
> echo readfile($filename);
> exit;
>
> now it displays the contents of the text.txt file.  I originally had just
> /include/text.txt but it told me no such file existed.  But once I added the
> root directory stuff in front of that, it works.
>
> I'm having a similar problem getting smarty to run, it keeps telling me that
> it can't find index.tpl and now I think I know what the problem is...
>
> Thanks to everyone
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] output of fread() is blank - FIXED - updated

2003-01-27 Thread Guru Geek
In all actuality I will be manipulating the information that is in that file.

I'm trying to build a log in script.  The id's and passwords are stored in a
text file.  I'm trying to read that text file so I can compare what the
user/viewer had typed in the id and password boxes.  I'm so new to PHP I'm
taking it in baby steps...

Philip Olson wrote:

> On Mon, 27 Jan 2003, Guru Geek wrote:
>
> > Sorry, here is the code now ( I need a nap )
> >
> > $filename
> > ="/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
> > $handle = fopen ($filename, "r");
> > $contents = fread ($handle, filesize ($filename));
> > fclose ($handle);
> > echo $contents;
> > exit;
>
> For something like this, just use readfile() and not fread
> as it'd be much more efficient if you don't actually manipulate
> the string $contents.  So:
>
>   readfile($filename);  // note: do not use echo
>
> Also, what is your include_path setting?  It's important
> you know it and what it means as that'll answer the
> question in your last post:
>
>   print ini_get('include_path');
>   http://www.php.net/manual/configuration.directives.php#ini.include-path
>
> Also, no need for "exit" here as that happens automatically.
>
> Regards,
> Philip



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php conditional formatting question

2003-01-28 Thread Guru Geek
I'm new to PHP but I had a similar problem.  I was comparing information in a
flat text file with a variable in my php code.  They never matched according to
the php.  I echo'd both values to the screen and they matched.  So then I echo'd
them to the screen with three 'a' in front and three 'a' in back of the values.
Much to my suspicion there was a blank space behind the value from the text
file.  So, I used rtrim to get rid of the blank space.  Looks something like
this:

$contents[1] = rtrim($contents[1]);

  if ($idname = = $contents[0]) {
 echo "Works Thus Far!";
 exit;
  }

Hope this is helpful! ! !
Roger



WMB wrote:

> I know it's possible, but I just can't get it working.
> In an old file I have a straight php coding doc where it's used and am now
> trying to mimic the resulting output.
>
> I'm trying to get a result from a query in a specific color when it fits the
> bill
>  (
>  if ($teamcaptain == $deelnemer)
>   //if yes, we'll make the result green
>   echo ""; etc
>
> (SEE BELOW))
>
> when the person ($deelnemer) also fits the $teamcaptain I want this one to
> be listed in different format, I dont care if it's only color or if it's a
> css.
> Hope there's someone able to help me here, thanks,
>
> Martin
> The Netherlands
>
> part of php code:
>
>  do { ?>
>   
>   $teamcaptain;
>   $deelnemer = strtoupper($row_rsCompetitie['zoekcode']);echo $deelnemer;?>
>   if ($teamcaptain == $deelnemer)
>   //if yes, we'll make the result green
>   echo "";
>   }
> ?>
> 
>  ?>
> 
> 
> 
> 
> 
>   
>   
> 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] .php extensions versus .html

2003-01-30 Thread Guru Geek
I was wondering, can you call a php script in the middle of a html page?

I've seen some sites use code like this:




Untitled


HELLO WORLD!!!





but when I try it, the php script doesn't run.


Does anyone else know how to use php on a page and yet keep the .html
extension?

Thanks in advance,
Roger



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Long Email - Array Problems Causing My Baldness

2003-02-01 Thread Guru Geek
Hello Everyone,

I've been working on a small pet project of mine.  It involves link
management for my site.  I want to be able to tell the program how many
links to display from each of my link files.  The program is then to go
to that individual link file, randomly pick out how ever many links I've
told it to get and then display a description of each link.  The
description is to be hyperlinked to the actual URL of that link.

I have a directory that contains 5 text files.  Those 5 files each
contain 10 links.  Each line in a file has two elements.  The first
being a url, the second being a description.  The two elements are
delimited by a comma.  Here is what they would look like:
http://www.File1.com/Link1,File 1 Link 1
http://www.File1.com/Link2,File 1 Link 2
http://www.File1.com/Link3,File 1 Link 3

My php code is actually two programs.  The first program asks for my
input.  Basically it's a list of the file names with a text box next to
each.  In that text box I can choose how many links to display from each
file.  So let's say I choose to display 2 links from the first file, 0
links form the second file, 3 links from the third file, 0 links from
the 4th file and 5 links from the fifth file.  The program then writes
the following to a simple text file:
2
0
3
0
5

The second program does all of the fun stuff.  The first step being to
open that text file and read the values:
//open result file and read admin count into array
$filepointer = fopen ($filename, "r");
$array_admin_count = file ($filename);
fclose ($filepointer);

The next step then opens the directory which contains the 5 files of
links and reads each file name:
//open directory and read file names
$open = opendir ($dir);
while ($files = readdir ($open))
  {
 if ($files != "." && $files != "..")
 {
  $filesnames = $dir.$files;
 $array_of_files[] = $filesnames;
 }
  }
closedir ($open);

The final part is pretty beefy.  This is where my problem is.  This part
is to open the individual link files, generate the proper amount of
random links and then display the description which is hyperlinked to
the url.  It works if you only choose to display either 0 links from a
file or 1 link from a file.  If you choose anything over 1 random link,
it displays the proper information, but it's mashed together.  Here is
the code for the final section of part two:
//open files and grab random links
for ($counter = 0; $counter < count($array_admin_count); $counter++)
 {
 $array_admin_count[$counter] = rtrim($array_admin_count[$counter]);

 if ($array_admin_count[$counter] > 0)
 {
 //Initialize:
  $res_string = '';
  $res = array();
 //expose url's in file
 $fileopen = fopen ($array_of_files[$counter], "r");
 $array_of_links = file ($array_of_files[$counter]);
 fclose ($fileopen);
 //choose $number random lines from file
  $keys = array_rand($array_of_links,$array_admin_count[$counter]);
  //store random lines into $res array
if(is_array($keys))
{
foreach($keys as $key)
{ $res[] = $array_of_links[$key]; }
}else{
   $res[] = $array_of_links[$keys];
   }
 //if randomize is on, randomize result array
if($randomize_results==1)
{
  shuffle($res);
  }
  //convert result array to string
$res_string = implode("",$res);
  $getlink = explode(",", $res_string);
print ("$getlink[1]");


Here's what I can figure out:
Choosing 0 random links works for obvious reasons.  Choosing to display
1 random link works because the array $res will look like this:
http://www.File1.com/Link1,File 1 Link 1
The program then creates $res_string.  Then the program explodes
$res_string based on the comma delimiter into the array $getlink.  Then
the program displays the two elements of $getlink in the proper manner.

If you choose to display more then 1 random link the program gets
buggy.  Let's say you choose to display 2 random links.  When the
program gets down to the $res array, the value of $res is:
http://www.File1.com/Link1,File 1 Link 1 http://www.File1.com/Link2,File
1 Link 2

Once this happens, the next few lines of code $res_string (by implode)
and the $getlink (by explode) creates havoc.  I've been up all night
trying to figure out a solution.  I can't seem to arrive at one.  Might
any of you have any idea what I can do to resolve this array issue?

Sorry this email is so long and my description is probably confusing.

Thanks in advance,
Roger

PS
if you wish to see the problem first hand, go here, and choose 1 link
from each file.  Then go back to it and choose more then 1 and see what
happens:
 http://www.g-i-w-s.com/php/test31.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem When Linking Array Element To Itself

2003-02-08 Thread Guru Geek
Hello,

I have an array called $array_of_files.
I want to echo each element of that array as a link to itself.
That way when I click on an element I can send it as an actual value

Here's my code:

for ($counter = 0; $counter < count($array_of_files); $counter++)
 {
 $category = $array_of_files[$counter];
 echo "$category";
 }
 exit;
}

Here's an example of the variable $category before I place it in the :
/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt

Once I place the variable $category inside the  statement it
looks like this:
http://www.myserver.com/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt

Why is it the  adds 'http://www.myserver.com' to the front of
the value of $category?

I worked around this by placing '?file=$category' in the echo statement
above.  Just wondered if anyone had any better way to do this...

Thanks in advance,
Roger



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] appending file with new line first

2003-02-09 Thread Guru Geek
Hello,

Yep, me again, with yet another php question.
Maybe I'm too tired to see the easy solution...

I open a file and write to it:
   $handle = fopen ($temp_file, 'a');
   fwrite($handle, $original_info);
   fclose ($handle);

Later I want to add to the above file:
   $handle = fopen ($temp_file, 'a');
   fwrite($handle, $new_info);
   fclose ($handle);

Here's what the file now looks like:
original info
original info
original info
original info
new infonew info

I'm trying to achieve:
original info
original info
original info
original info
new info
new info

It writes the very first piece of new info on a new line.  That is
good.  The second piece of new info gets written right at the exact end
of the file.  I've tried fwrite($handle, $new_info\n) but that creates
an error.  So does  fwrite($handle, $new_info\r);

How can I get the new info to go on its own line in the file?

Thanks,
Roger



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Delimited file values behaving strangely...

2003-02-10 Thread Guru Geek
When this happens to me I always just echo the variable value like so to
see if something is there that shouldn't be:

echo "";
echo "$id";
echo "";

obviously all this does is print the variable with a bunch of c's before
and after.  That way I can see if there are any extra things included with
the value that shouldn't be there.

Then use the trim() commands as someone else mentioned.

Roger

Geoff Caplan wrote:

> Hi folks,
>
> A strange one - unless I am having a brainstorm...
>
> I am reading in tab delimited files created in Excel on Windows and
> uploaded to Linux.
>
> Cell A1 contains a numeric id - I extract this into a variable, $id,
> by exploding on \n and \t.
>
> But for some files, the values of $id do not behave as expected. Say
> the value should be "23".
>
> If I echo, it prints as "23". But comparisons fail to match:
>
> if( $id == 23 ) ...
>
> It also fails if I try to find the value as a key in an
> array:
>
> if( isset( $my_array[$id] ) ) ...
>
> On the other hand, values from some of the files work as expected.
>
> One clue: if I try and cast the values that are failing to int, the
> cast produces the value 0 (zero). On the other hand, the values that
> are working as expected cast from, say, the string 22 to the int 22 as
> expected.
>
> Never seen anything like this before - can anyone give me a pointer??
>
> --
>
> Geoff Caplan
> Advantae Ltd
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Program Outputs 'Resource id3'

2003-02-15 Thread Guru Geek
Simple program that opens a txt file and reads two van numbers.  Then,
for each van number, it opens a database and grabs the sum of the gross
pay column.

The problem is I get 'Resource id3' for the first van's gross pay and
'Resource id4' for the second van's gross pay.

Here's the code:

if ($viewYearEnd)
{
$readThis = ($dir."vans.txt");
$Open = fopen ($readThis, "r") or die ("Call Roger, cannot open
$readThis");
$vanList = file ($readThis);
fclose ($Open);

for ($count = 0; $count < count($vanList);$count++)
  {
  $run_sql_grossPay = "SELECT SUM(grossPay) FROM $usertableDaily WHERE
vanNumber=$vanList[$count]";
  $grossPay = mysql_query($run_sql_grossPay);
  ?>
  
  
  
  
 
  
 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP not running/parsin MySQL query

2003-02-15 Thread Guru Geek
Hello,

I've been having extensive email conversations with people over at
MySQL.com's email list.  From what I'm able to prove using myphpadmin,
my problem is not with the query, but with how PHP handles it.

All I want to do is open a text file, read in  two van numbers that are
there.  I want to then query a table and find out what the gross pay was
for each van.

I've set up a test model.  The text file contains two van numbers and
looks like this:



The table contains the following:
+-+---+
 |  vanNumber |   grossPay |
 |--||
 | |1000  |
 | |  500  |
 | |  100  |
 | |  100  |
+-+---+

I can log into myphpadmin and execute the following query:
SELECT SUM(grossPay) FROM Nero_Daily_03 WHERE vanNumber=

I get a result of 200, which is the correct answer.

I can log into myphpadmin and execute the following query:
SELECT SUM(grossPay) FROM Nero_Daily_03 WHERE vanNumber=

I get a result of 1500, which is the correct answer.

Now, lets jump to my php code.  Here is the Routine I'm trying to
accomplish:

if ($viewYearEnd)
{
$readThis = ($dir."vans.txt");
$Open = fopen ($readThis, "r") or die ("Call Roger, cannot open file
$readThis");
$vanList = file ($readThis);
fclose ($Open);

$trimmedVanOne = rtrim($vanList[0]);
$trimmedVanTwo = rtrim($vanList[1]);
$sql = "SELECT SUM(grossPay) FROM Nero_Daily_03 WHERE vanNumber=";
$run_sql = mysql_query($sql);
?>
  
  
  
  
 

  
  
  
 
  
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Image Stored in DB has errors

2003-07-17 Thread Guru Geek
Hello,

I went to bed last night and this was working.  I woke up this morning
and something has happened or someone has tampered with it.  I have
noticed that the LONGBLOB in the database which stores the actual binary
of the image states that it contains 25.3k and the actual 'image_size'
field states 25.9k and I'm wondering if something is trimming part of
the image off.  Can anyone out there in PHP land spot an error in my
code that would create a problem like this?  When I try to view the
photos it returns "the picture you are trying to view contains errors".

HERE'S THE CODE FOR INSERTING PHOTOS INTO THE DATABASE:

if ($userpic != "none")
  {
$image = addslashes (fread(fopen
($HTTP_POST_FILES["userpic"]["tmp_name"], "r"),
   filesize
($HTTP_POST_FILES["userpic"]["tmp_name"])));
$File_name = strtolower($HTTP_POST_FILES["userpic"]["name"]);
$File_size = $HTTP_POST_FILES["userpic"]["size"];
$File_type = strtolower($HTTP_POST_FILES["userpic"]["type"]);

function filecheck($File_name)
{
 $ext = strrchr($File_name, ".");
 $image_type = array (".png", ".jpg", ".jpeg", ".bmp", ".gif",
".tif", ".tiff", ".pcx");
 if ( in_array ($ext, $image_type) )
{
global $goodext;
 $goodext = 1;
}
}

filecheck($File_name);
if (!$goodext)
{
echo "Your photo is not in a valid format.";
   exit;
}
  } else {
  $File_name = " ";
  }

$db_host="localhost";
$db_user="";
$db_pass="";
$db_db="main";
mysql_connect($db_host,$db_user,$db_pass) or die(mysql_error());
mysql_select_db($db_db) or die(mysql_error());

$do= "INSERT INTO table
(name,email,age,location,interests,about,image,image_type,image_size,image_name)
VALUES
('$name','$email','$dobtimestamp','$location','$interests','$about','$image','$File_type','$File_size','$File_name')";

$r=mysql_query($do) or die(mysql_error());

HERE'S THE CODE FOR VIEWING SAID PHOTOS:
$r=mysql_query("SELECT
name,email,age,location,interests,about,image_size FROM table WHERE
name='$name'");
$a=mysql_fetch_array($r);
if ($a['image_size'] > 0)
  {
   print "";
  }

HERE'S THE CODE FOR getimage.php:


Thank all of you in advance,
Rog



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Session Not Working

2003-03-21 Thread Guru Geek
Hello,

I'm trying to use sessions for the first time.

I have a log in script that gets the user to enter their name and
password.  Then the script compares the entered data to a database.  If
the entered data matches whats in the database then the user is granted
access to the main php script.

basically my code in the log in script is this:

if ($user_data = = $database_data) {
$_SESSION['verified_user']=1;
header("Location:http://www.myserver.com/main.php";);
exit;

The opening code in my main.php script is this:
session_start();
if ( isset($_SESSION['verified_user'])) {
run the whole script
}else {
return to log in page
exit;
}

Anyone care to clue me in as to why I'm always sent back to the log in
page even when the log in is correct?

Did I miss the session boat all together?  Perhaps I'm not grasping it
at all..

Thanks,
Roger








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Session Not Working

2003-03-21 Thread Guru Geek
ok, I tried this:
session_start();
if ($user_data = = $database_data) {
$_SESSION['verified_user']=1;
header("Location:http://www.myserver.com/main.php";);
exit;

and it still doesn't work...hehe

anymore suggestions?

Thanks,
Roger

Mike wrote:

> you forgot session_start at the beginning of the login script
>
> On Fri, 2003-03-21 at 12:31, Guru Geek wrote:
> > Hello,
> >
> > I'm trying to use sessions for the first time.
> >
> > I have a log in script that gets the user to enter their name and
> > password.  Then the script compares the entered data to a database.  If
> > the entered data matches whats in the database then the user is granted
> > access to the main php script.
> >
> > basically my code in the log in script is this:
> >
> > if ($user_data = = $database_data) {
> > $_SESSION['verified_user']=1;
> > header("Location:http://www.myserver.com/main.php";);
> > exit;
> >
> > The opening code in my main.php script is this:
> > session_start();
> > if ( isset($_SESSION['verified_user'])) {
> > run the whole script
> > }else {
> > return to log in page
> > exit;
> > }
> >
> > Anyone care to clue me in as to why I'm always sent back to the log in
> > page even when the log in is correct?
> >
> > Did I miss the session boat all together?  Perhaps I'm not grasping it
> > at all..
> >
> > Thanks,
> > Roger
> >
> >
> >
> >
> >



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Backing Up Tables Using PHP

2003-03-25 Thread Guru Geek
Hello,

Trying to author my own PHP database table back up utility.  A very
simple one at that...

Here's my sql statement to select everything in the table:

$sql_daily = "SELECT * FROM dailytable";
$run_sql_daily = mysql_query($sql_daily);
$result_sql_daily = mysql_fetch_array($run_sql_daily);

Here's the code for showing me whats in the result array:

for ($count_daily=0; $count_daily < count($result_sql_daily);
$count_daily++)
 {
 echo "";
 echo "$result_sql_daily[$count_daily]";
 }
exit;


Does anyone out there know why it only prints one line of the table?
It's a line in the middle of the table, it's not the first line, it's
not the last line, it's in the middle of about 25 lines.

Is this not the proper way to back up tables in a database?  I'd like a
back up copy of my tables on CD-ROM and I thought once this prints out
correctly I'd just have it print to a text file and then place the text
file on a cd

Thanks,
Roger






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] array count() oddity

2003-05-31 Thread Guru Geek
Hello,

I have a mysql statement listed below.  The table contains about 100
rows of information.  Only one row matches the $criteria.  Can anyone
tell me why the count($myrow) is 8?  Shouldn't it be 4 (id, vanNumber,
origin, destination)?

$criteria = "02-25-2003";
$result = mysql_query("SELECT id, vanNumber, origin, destination FROM
thisHereTable WHERE date='$criteria'");
$myrow = mysql_fetch_array($result);

And when I run the rest of the script, it prints out the results 8 times
instead of once
for ($count=0; $count".$myrow["vanNumber"];
print "".$myrow["origin"]." to ".$myrow["destination"];
}

THANKS,
Roger





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Another hosting question....

2003-06-19 Thread Guru Geek
Dear List,

I'll say it again, after viewing ALL of these 'hosting question' postsIf
you want really good, reliable, dependable service AND an excellent
combination of MB storage space and Transfer MB's then take a look at
http://www.webmasters.com

They even have 24 hour toll free phone support.  Control panel for your
domain management.  Several free scripts and package add ons.

No, I don't work for them, no I don't get kickbacks from them.  I'm just
that happy with their products and services...

Good Luck,
Roger

Boaz Yahav wrote:

> Check out :  http://weberdev.ref.phenominet.com
>
> This is your one stop shop for hosting. WeberDev.com is hosted there
> and I can tell you that their service is amazing. They are fast,
> reliable
> and more than anything, very professional (specially in PHP / MySQL).
> I have a dedicated server there for years.
>
> Sincerely
>
>   berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
> -Original Message-
> From: Mike Morton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 19, 2003 1:52 AM
> To: PHP eMail List
> Subject: [PHP] Another hosting question
>
> I know that this subject has been beaten to death, but I going through
> old lists, I see a lot of hosting companies for site hosting, but I am
> interested specifically in dedicated server hosting.
>
> It is tough to find a hosting facility that is state of the art, with
> big pipes and redundancy, but is not a huge corporate company that could
> not care less about you
>
> What I am looking for specifically is a company that someone can
> recommend from direct experience, one that is customer friendly, offers
> dedicated servers at a REASONABLE price, offers admin support and server
> support, etc, etc, etc, and most importantly has expertise in compiling
> PHP.
>
> If anyone out there know of a company like this and can recommend them -
> I would appreciate it :) It will save literally hours and hours of
> sorting through the  google listings that a php dedicated hosting search
> brings back!  (2 days of sorting to this point anyhow!)
>
> TIA
>
> --
> Cheers
>
> Mike Morton
>
> 
> *
> * Tel: 905-465-1263
> * Email: [EMAIL PROTECTED]
> *
> 
>
> "Indeed, it would not be an exaggeration to describe the history of the
> computer industry for the past decade as a massive effort to keep up
> with Apple."
> - Byte Magazine
>
> Given infinite time, 100 monkeys could type out the complete works of
> Shakespeare. Win 98 source code? Eight monkeys, five minutes.
> -- NullGrey
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php