Re: [PHP-DB] "marking" DB entries...

2002-03-22 Thread Frank Flynn

OK so you have 2 tables one for users login and one for the addresses a user
may store and retrieve.

Your users will login, you will validate their name and password combination
and have either a userID or the name is fine too (an integer ID is smaller
to store and possibly more efficient).

Now your PHP script will know the users name and userID (you will be looking
this up  each time they view a page or somehow storing it -- I assume you
know how to do this since this isn't what your were asking about)

So now you can search on your address table however you like but always be
sure to include:
   and authority  = $userID
In your where clause.  Obviously you include other conditions or your users
will get every single entry they ever made.

Just be sure that the insert and update functions will always set the
authority field to the proper userID.  If two users enter the same address
you will have two different records in the address table - identical except
for the authority field.

Easy as pie...

Good Luck,

Frank


On 3/22/02 8:25 PM, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> From: "Ljungan" <[EMAIL PROTECTED]>
> Date: Fri, 22 Mar 2002 18:07:06 +0100
> To: [EMAIL PROTECTED]
> Subject: "marking" DB entries...
> 
> Im making an adressbook using PHP and mySQL.
> I want each user to have access only to his/hers adressinputs. Now Im
> wondering how I gonna solve this, ofcourse its very easy just to create a
> table for each user but then the hole idea of "database" loose its purpose
> =). How can I "mark" each input so that only the specific user who entered
> the information can access it? If two users enters the exact same
> information I want them both to have access to it...
> 
> I was thinking about a table looking like this:
> name CHAR(30),
> adress CHAR(30),
> email CHAR(30),
> phonenumber INT(20),
> authority ENUM()//here is my thought--
> 
> I was thinking I could save the users name in "authority" and thereby
> marking that this entry was made bye the specific person. Is it possible to
> use this? Please give me a few pointers or better, give me a website where I
> can read about it...
> thanks!
> /Ljungan


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




[PHP-DB] Re: urgent guys

2002-03-22 Thread Adam Royle

You cannot use javascript variables in php, nor php variables in 
javascript, unless you write the variable to the page (for php -> 
javascript) or post to a new page with querystring or form 
(javascript -> php).

php -> javascript:


var jsVariable = "";


javascript -> php:


// this is probably wrong javascript syntax, but you get the idea
location.href = "thing.php?q=first+one&p=second+one";


Adam

> i know it has nothing to do with php but i'm stuck:)
>
> i have this url:
> http://localhost/auction/seller/additems.php?category=Books&subcategory=Fiction
>
> and in javascript when i say for example alert(category) it gives me 
> undefineddoesn't javascript see variables passed with the url???
>
>
> Rehab M.Shouman



Re: [PHP-DB] "marking" DB entries...

2002-03-22 Thread Adam Royle

I have done an address book in php, although I kept the 
username/password in with the rest of their details. If you wanted to 
keep it all in two tables, then go ahead. You really should have an ID 
field in every table, whether you use it or not, and most of the times, 
you'll find you will use it. So if you're using two tables, you'll have 
a column in each of them 'linking' up the columns (ie, the same number). 
If you don't know how to do this, there are tons of tutorials on the net 
which gloss over this... (have a look at the mysql 
documentation/examples).

Then on your actual page, what you should do is have a login page, which 
checks a username/password from a form against the database. At the same 
time, retrieve the ID number where it matches the user/name password and 
put the username and id number in separate session variables.

Once you have the ID number of the person logged in, you can 
allow/disallow what they can edit depending on the ID. If you need 
further help, contact me directly.

Adam.




> Im making an address book using PHP and mySQL.
> I want each user to have access only to his/hers adressinputs. Now Im
> wondering how I gonna solve this, ofcourse its very easy just to 
> create a
> table for each user but then the hole idea of "database" loose its 
> purpose
> =). How can I "mark" each input so that only the specific user who 
> entered
> the information can access it? If two users enters the exact same
> information I want them both to have access to it...
>
> I was thinking about a table looking like this:
> name CHAR(30),
> adress CHAR(30),
> email CHAR(30),
> phonenumber INT(20),
> authority ENUM()//here is my thought--
>
> I was thinking I could save the users name in "authority" and thereby
> marking that this entry was made bye the specific person. Is it possible
> to
> use this? Please give me a few pointers or better, give me a website 
> where
> I
> can read about it...
> thanks!
> /Ljungan



[PHP-DB] Remote Connection to Mysql

2002-03-22 Thread Marcus Rigby

Hi all,
I know there are plenty of remote connection posts herebut none have
helped me solve my problem.

I have 2 win98 machines on a novell network, both have static IP
addresses, and both machines can ping each other.  One machine is
running a webserver and the other the Mysql server, and I cannot get
scripts on the webserver to connect to MySql.

Using :
$dbcnx = mysql_connect("xxx.xxx.xxx.xxx", "user", "pword");
if (!$dbcnx) {
echo( "Unable to connect to the " .
"database server at this time.Try again later" );
exit();
}

RESULTS in the error message Unable to connect to the database
server.

When I do a netstat -a on the PC with MySQL I dont see any listening
ports, should there be.

Is anybody able to shed some light on this for me???

Thanks
Marcus



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




Re: [PHP-DB] urgent guys

2002-03-22 Thread maxwello

> and in javascript when i say for example alert(category) it gives me
undefined
> doesn't javascript see variables passed with the url???

Nope.  You'll have to parse the URL and search for your variables.
Take a look at using the location.search property.

Maxwell



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




[PHP-DB] urgent guys

2002-03-22 Thread its me

i know it has nothing to do with php but i'm stuck:)

i have this url:
http://localhost/auction/seller/additems.php?category=Books&subcategory=Fiction

and in javascript when i say for example alert(category) it gives me 
undefineddoesn't javascript see variables passed with the url???


Rehab M.Shouman





-
Express yourself with a super cool email address from BigMailBox.com.
Hundreds of choices. It's free!
http://www.bigmailbox.com
-

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




Re: [PHP-DB] Multiple SELECT querys

2002-03-22 Thread Jim Lucas [php]

I will take this example and improve upon it, try this:

$query = "SELECT myvalue FROM mytable WHERE some_condition";
$result = mysql_query($query) or die("Error: ".mysql_error());
$srch = array();
while( list($myvalue) = mysql_fetch_array($result)
{
$srch[] = $myvalue;
}
$query = "SELECT * FROM other_table WHERE this_val IN('". join("', '",
$srch). "')";
$result = mysql_query($query) or die("Error: ".mysql_error());

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Morten Nielsen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 12:53 PM
Subject: RE: [PHP-DB] Multiple SELECT querys


> $query = "SELECT myvalue FROM mytable WHERE some_condition";
> $result = mysql_query($query) or die("Error: ".mysql_error());
> $srch = "";
> while( list($myvalue) = mysql_fetch_array($result)
> {
> $srch .= "$myvalue, ";
> }
> $srch = substr($srch, 0, -2);
> $query = "SELECT * FROM other_table WHERE this_val IN($srch)";
> $result = mysql_query($query) or die("Error: ".mysql_error());
>
> -Original Message-
> From: Morten Nielsen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 2:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Multiple SELECT querys
>
>
> Hi,
>
> I make a SELECT in a mySQL database. It returns a variable, which contains
> 10 values. I then need to make another SELECT in a new database where I
have
> to use the previous 10 values in the WHERE sentence. How can I do this?
>
> Regards,
> Morten
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




RE: [PHP-DB] Selecting Alphabetically

2002-03-22 Thread Robert V. Zwink

In MySQL you can also do this:

SELECT * FROM artists
WHERE
 LEFT(title, 1) >= 'A'
AND
 LEFT(title, 1) <= 'H'
ORDER BY title

This will return a range of all artists whose title begins with A thru H.
Treat the letters like numbers.

Robert V. Zwink
http://www.zwink.net/daid.php

-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 7:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Selecting Alphabetically


Hi,
Could anyone point me in the right direction with this one please.
I have a table of records wit a field of artists.

I want to select all the records which begin with the letter a-h then i-p
etc

What is the best way to do this?

Cheers,
Jord

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


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




RE: [PHP-DB] Multiple SELECT querys

2002-03-22 Thread Rick Emery

$query = "SELECT myvalue FROM mytable WHERE some_condition";
$result = mysql_query($query) or die("Error: ".mysql_error());
$srch = "";
while( list($myvalue) = mysql_fetch_array($result)
{
$srch .= "$myvalue, ";
}
$srch = substr($srch, 0, -2);
$query = "SELECT * FROM other_table WHERE this_val IN($srch)";
$result = mysql_query($query) or die("Error: ".mysql_error());

-Original Message-
From: Morten Nielsen [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 2:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Multiple SELECT querys


Hi,

I make a SELECT in a mySQL database. It returns a variable, which contains
10 values. I then need to make another SELECT in a new database where I have
to use the previous 10 values in the WHERE sentence. How can I do this?

Regards,
Morten



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

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




Re: [PHP-DB] help php4.0.6&Oracle9i !

2002-03-22 Thread Rafael Schleuss

ORA-12154: TNS:could not resolve service name
Cause: The service name specified is not defined correctly in the
TNSNAMES.ORA file.

Action: Make the following checks and correct the error:
- Verify that a TNSNAMES.ORA file exists and is in the proper place and
accessible. See the operating system specific manual for details on the
required name and location.
- Check to see that the service name exists in one of the TNSNAMES.ORA files
and add it if necessary.
- Make sure there are no syntax errors anywhere in the file. Particularly
look for unmatched parentheses or stray characters. Any error in a
TNSNAMES.ORA file makes it unusable. See Chapter 4 in the SQL*Net V2
Administrator's Guide. If possible, regenerate the configuration files using
the Oracle Network Manager.




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




[PHP-DB] Multiple SELECT querys

2002-03-22 Thread Morten Nielsen

Hi,

I make a SELECT in a mySQL database. It returns a variable, which contains
10 values. I then need to make another SELECT in a new database where I have
to use the previous 10 values in the WHERE sentence. How can I do this?

Regards,
Morten



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




RE: [PHP-DB] "marking" DB entries...

2002-03-22 Thread Rick Emery

well...what the bloody hell are you looking for from us?

-Original Message-
From: Ljungan [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] "marking" DB entries...


well that wasn't very helpful... I have two tables already, users and
adressreg

???

/ljungan



"Rick Emery" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> store and validate a username and password with each user's info
>
> -Original Message-
> From: Ljungan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 11:07 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] "marking" DB entries...
>
>
> Im making an adressbook using PHP and mySQL.
> I want each user to have access only to his/hers adressinputs. Now Im
> wondering how I gonna solve this, ofcourse its very easy just to create a
> table for each user but then the hole idea of "database" loose its purpose
> =). How can I "mark" each input so that only the specific user who entered
> the information can access it? If two users enters the exact same
> information I want them both to have access to it...
>
> I was thinking about a table looking like this:
> name CHAR(30),
> adress CHAR(30),
> email CHAR(30),
> phonenumber INT(20),
> authority ENUM()//here is my thought--
>
> I was thinking I could save the users name in "authority" and thereby
> marking that this entry was made bye the specific person. Is it possible
to
> use this? Please give me a few pointers or better, give me a website where
I
> can read about it...
> thanks!
> /Ljungan
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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

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




RE: [PHP-DB] "marking" DB entries...

2002-03-22 Thread Rick Emery

store and validate a username and password with each user's info

-Original Message-
From: Ljungan [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] "marking" DB entries...


Im making an adressbook using PHP and mySQL.
I want each user to have access only to his/hers adressinputs. Now Im
wondering how I gonna solve this, ofcourse its very easy just to create a
table for each user but then the hole idea of "database" loose its purpose
=). How can I "mark" each input so that only the specific user who entered
the information can access it? If two users enters the exact same
information I want them both to have access to it...

I was thinking about a table looking like this:
name CHAR(30),
adress CHAR(30),
email CHAR(30),
phonenumber INT(20),
authority ENUM()//here is my thought--

I was thinking I could save the users name in "authority" and thereby
marking that this entry was made bye the specific person. Is it possible to
use this? Please give me a few pointers or better, give me a website where I
can read about it...
thanks!
/Ljungan



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

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




[PHP-DB] "marking" DB entries...

2002-03-22 Thread Ljungan

Im making an adressbook using PHP and mySQL.
I want each user to have access only to his/hers adressinputs. Now Im
wondering how I gonna solve this, ofcourse its very easy just to create a
table for each user but then the hole idea of "database" loose its purpose
=). How can I "mark" each input so that only the specific user who entered
the information can access it? If two users enters the exact same
information I want them both to have access to it...

I was thinking about a table looking like this:
name CHAR(30),
adress CHAR(30),
email CHAR(30),
phonenumber INT(20),
authority ENUM()//here is my thought--

I was thinking I could save the users name in "authority" and thereby
marking that this entry was made bye the specific person. Is it possible to
use this? Please give me a few pointers or better, give me a website where I
can read about it...
thanks!
/Ljungan



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




[PHP-DB] Re: calculations based on checkbox value

2002-03-22 Thread jas

 10) { # if the users ad has more than 10 words in it than
$quarters = the extra words times .20
 $subtractor = $num - 10;
 $quarters = $subtractor * .20;
}
$subtotal = $price + $quarters; # price plus the number of words over 10
$total = $papers * $subtotal; # new price multiplied by number of papers
$total = $total * $weeks; # new new price multiplied by number of weeks
$total = sprintf ("%01.2f", $total);
?>
Here is part of my function thus far, and the output is a simple $$ based on
the number of words, I just need to add an IF statement to determine whether
or not I will need to subtract a certain amount if a checkbox is checked. I
am assuming that the IF statement would be something like...
IF $variable = 1; {
 $variable - $total = $total2
)
Else do the rest of the code...
I am still a newbie to php so any help would be great.
Thanks in advance,
Jas
"Jas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok here is my problem, currently I have a form that calculates the number
of
> words in a given textarea.  Now what I need to accomplish is using a
> checkbox to subtract a value based on said checkbox.  I have looked for a
> tutorial on such an item and did not find one so I am asking if anyone out
> there has accomplished a similar function and if so could you point out a
> good tutorial or let me see some sample code?  Thanks in advance,
> Jas
>
>



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




RE: [PHP-DB] calculations based on checkbox value

2002-03-22 Thread matt stewart

can you post some code, and an exmaple of an input, the current output, and
what the desired output would be?

-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 04:57
To: [EMAIL PROTECTED]
Subject: [PHP-DB] calculations based on checkbox value


Ok here is my problem, currently I have a form that calculates the number of
words in a given textarea.  Now what I need to accomplish is using a
checkbox to subtract a value based on said checkbox.  I have looked for a
tutorial on such an item and did not find one so I am asking if anyone out
there has accomplished a similar function and if so could you point out a
good tutorial or let me see some sample code?  Thanks in advance,
Jas



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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02
 

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




[PHP-DB] calculations based on checkbox value

2002-03-22 Thread jas

Ok here is my problem, currently I have a form that calculates the number of
words in a given textarea.  Now what I need to accomplish is using a
checkbox to subtract a value based on said checkbox.  I have looked for a
tutorial on such an item and did not find one so I am asking if anyone out
there has accomplished a similar function and if so could you point out a
good tutorial or let me see some sample code?  Thanks in advance,
Jas



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




Re: [PHP-DB] Creating a good search engine

2002-03-22 Thread olinux

I would recommend going with a table of keywords like
you said, you may want ot structure like this:

[ words_id | article_id | word ]

You can tie the "article id" to the other tables
getting an efficient multiple word search working is a
bit of a task. 

This is very helpful:
http://www.databaseanswers.com/data_models/search_engine.htm

A couple articles I found helpful:
http://www.zend.com/zend/spotlight/websearchengine2may.php#Heading2
http://www.phpbuilder.com/columns/clay19990421.php3

olinux


--- Mike de Libero <[EMAIL PROTECTED]> wrote:
> Hi Guys,
> 
> I need to create a search engine that catalogs
> data from about 4 separate tables, and then of
> course is searchable from use input.  I'm having a
> brain fart on how I should go about doing this. 
> This is what I think I should do so far tell me if
> I'm right or at least going in the right direction.
>   
> 1) Scan the each table and put them in one huge
> database filtering out "noise words"
> (I was thinking attaching a word id to the
> word so there would be no repeating words??)
> 2) Attach the wordID to the corresponding
> article or blurb. 
> 3) Use the search function to search that table.
> 
>   Now hopefully that sounds about right I just
> have one other problem.  I can't really envision the
> code to do the sorting of the words etc.  Any useful
> pointers would be helpful not looking for a total
> solution rather a hint to get me started in the
> right direction.  Hope you guys can help.
> 
> -Mike de Libero
> [EMAIL PROTECTED]
> http://www.soreye.com
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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




[PHP-DB] Creating a good search engine

2002-03-22 Thread Mike de Libero

Hi Guys,

I need to create a search engine that catalogs data from about 4 separate tables, 
and then of course is searchable from use input.  I'm having a brain fart on how I 
should go about doing this.  This is what I think I should do so far tell me if I'm 
right or at least going in the right direction.
  
1) Scan the each table and put them in one huge database filtering out "noise 
words"
(I was thinking attaching a word id to the word so there would be no repeating 
words??)
2) Attach the wordID to the corresponding article or blurb. 
3) Use the search function to search that table.

  Now hopefully that sounds about right I just have one other problem.  I can't 
really envision the code to do the sorting of the words etc.  Any useful pointers 
would be helpful not looking for a total solution rather a hint to get me started in 
the right direction.  Hope you guys can help.

-Mike de Libero
[EMAIL PROTECTED]
http://www.soreye.com




[PHP-DB] Re: insert into javascript php

2002-03-22 Thread Adam Royle

PHP cannot recognise javascript variables because javascript is 
interpreted via the browser, and not the server (which php is). for php 
to use javascript variables, you must post the variable to another page 
using either a form or querystring.

Adam

> 
>
> c=document.forms[0].category.options[document.forms[0].category.selectedIndex]
> .text
>  $x=c;
> ?>
>
> 
>
> but the php doesn't understand this c variable


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




[PHP-DB] RE: Forms

2002-03-22 Thread Keiran Wynyard

maybe try escaping the " characters in the last line, or using ' instead...?

Keiran

-Original Message-
From: Ron [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:05 PM
To: [EMAIL PROTECTED]
Subject: Forms


I know this is suppose to be databases, but the most knowledgeable people
seem to be in here.

This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

 "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
{

if(strlen($text)) {$text .= "";}
$function = "form_" . $v["type"];
$text .= $function($name. $v);
}
  return(""
  . $text
  . ""
  . "");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
{
if(strlen($output))
  {
  $output .= "";
  }
$output .= "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] PHP and HTML problems

2002-03-22 Thread Keiran Wynyard

Is it possible for you to post a link for it, so that I do not have to try
and make it work as it stands at the moment?

I am more an HTML wiz than a PHP guru, and I think I may have had a similar
problem in the past that I solved, so I will try to help

Keiran

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 9:12 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PHP and HTML problems


The file did not attach to the problem I asked for earlier. Here is what I
need below:
HI People,

I do not use dreamweaver normally, but have to do a few changes and add some
php code to this site.

I wonder if someone could quickly look at the attached php page, and look at
the navigation i use and see why it is looping within the html. Basically I
need the records to look but not the next and previous section for the
navigation.

If someone could let me know where I am going wrong, as its urgent. It is
the
html formatting that I think I cannot quite get to grips with.

Thanks

Barry

Here is the file below

***




In Press Technical Marketing: Client List

p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt}
li {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt}
td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt}









  

  







  
  
  

  
  
  
  
  
  
  

 
   
  
  


  
  
  
  
  

  
Here are the results of your
search: [ back to search ]
  
\n");
echo ("\n");
echo ("\n");

$count = 1;
$numcols = 3;
$limit = 2;

if ($industry_area != "") :
$sqlcount= "SELECT * FROM clients WHERE ('$industry_area' = industry_area)
ORDER BY clientname DESC";

elseif ($clientname != "") :
$sqlcount= "SELECT * FROM clients WHERE ('$clientname' = clientname) ORDER
BY clientname DESC";

elseif ($number != "") :
$sqlcount= "SELECT * FROM press_release WHERE ('$number' = number) ORDER BY
clientname DESC";


endif;


$sql_countresult = mysql_query($sqlcount);
$totalrows = mysql_num_rows($sql_countresult);

if(empty($page)){ 
$page = 1; 
} 

$limitvalue1 = $page*$limit-($limit); 

if ($industry_area != "") :
$sql= "SELECT * FROM clients WHERE ('$industry_area' = industry_area) ORDER BY 
clientname DESC LIMIT $limitvalue1, $limit";

elseif ($clientname != "") :
$sql= "SELECT * FROM clients WHERE ('$clientname' = clientname) ORDER BY clientname 
DESC LIMIT $limitvalue1, $limit";

elseif ($number != "") :
$sql= "SELECT * FROM press_release WHERE ('$number' = number) ORDER BY clientname DESC 
LIMIT $limitvalue1, $limit";

endif;

$sql_result = mysql_query($sql); 

if (mysql_num_rows($sql_result) ==0)
{

echo ("Sorry No results found\n");


} else {

while ($row = mysql_fetch_array($sql_result)){
echo ("  \n");
echo ("  \n");
echo ("   Name\n");
echo ("  \n");
echo ("   $row[clientname]\n");
echo ("  \n");
echo ("\n");
echo ("   Yrs With Inpress\n");
echo ("$row[years_at_inpress]\n");
echo ("   \n");
echo ("\n");
echo (" Press Releases\n");
echo (" View Press 
Realeases\n");
echo ("   \n");
echo ("\n");
echo (" Case Studies\n");
echo (" View Case 
Studies\n");
echo ("   \n");
?>
   

  


 PREV "; // if page is not equal to one, prev goes to $page - 1 
} 
else { 

} 
$numofpages = $totalrows/$limit; 

for($i= 1; $i < $numofpages; $i++) { 
if($page == $i) { 
echo " $i "; //make number 
navigation 
} 
else{ 
echo "
 $i "; //make number navigation 
} 
} 

if($totalrows%$limit != 0) { 
if($page > $numofpages) { 
echo " $i "; //make number 
navigation 
} 
else{ 
echo "
 $i "; if there is a remainder, add another page 

} 
} 

if(($totalrows-($limit*$page)) > 0){ 
$pagenext = $page + 1; 
echo "NEXT
 "; // if the totalrows - $limit * $page is > 0 (meaning there is a 
remainder), leave the next button. 
} 

}


}
mysql_free_result($sql_result);
?>

  

  
 
  
  

  
  




  
  






  


  
  
  
  



  


  
  
  
  
  
  
  




**


-- 
PHP Database Mailing List (http://www.php.net/)

Re: [PHP-DB] Forms

2002-03-22 Thread Ron

Line 53 is the line that is commented out
"Ron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> (((Point taken))) no harm intended
> Parse error: parse error in C:\**\*\tt.php on line 53
>
>
>



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




Re: [PHP-DB] Forms

2002-03-22 Thread Ron

(((Point taken))) no harm intended
Parse error: parse error in C:\**\*\tt.php on line 53




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




RE: [PHP-DB] Forms

2002-03-22 Thread Rick Emery

First:  cross-posting to multiple lists...not nice.  Most PHP folks are on
both lists.
Second: your first sentence seems to indicate that unknowledgeable people
inhabit the PHP list, vice the PHP-DB list.  H 
Third: what error do you get when you get the parsing error?

-Original Message-
From: Ron [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Forms


I know this is suppose to be databases, but the most knowledgeable people
seem to be in here.

This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

 "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
{

if(strlen($text)) {$text .= "";}
$function = "form_" . $v["type"];
$text .= $function($name. $v);
}
  return(""
  . $text
  . ""
  . "");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
{
if(strlen($output))
  {
  $output .= "";
  }
$output .= "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

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




[PHP-DB] Forms

2002-03-22 Thread Ron

I know this is suppose to be databases, but the most knowledgeable people
seem to be in here.

This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

 "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
{

if(strlen($text)) {$text .= "";}
$function = "form_" . $v["type"];
$text .= $function($name. $v);
}
  return(""
  . $text
  . ""
  . "");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
{
if(strlen($output))
  {
  $output .= "";
  }
$output .= "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] insert into javascript php

2002-03-22 Thread Marius Ursache



its me a écrit :

> 
>
> c=document.forms[0].category.options[document.forms[0].category.selectedIndex].text
>  $x=c;
> ?>
>
> 
>
> but the php doesn't understand this c variable
>
> Rehab M.Shouman
>

maybe is $x = $c ?

you can access that option from php
$HTTP_POST_VARS["name"]
$HTTP_GET_VARS["name"]


>
> 
> 
>
> -
> Express yourself with a super cool email address from BigMailBox.com.
> Hundreds of choices. It's free!
> http://www.bigmailbox.com
> -
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
  Marius Ursache (3563 || 3494)

   \|/  \|/
   "@'/ ,. \`@"
   /_| \__/ |_\
  \__U_/



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




[PHP-DB] insert into javascript php

2002-03-22 Thread its me



c=document.forms[0].category.options[document.forms[0].category.selectedIndex].text




but the php doesn't understand this c variable


Rehab M.Shouman





-
Express yourself with a super cool email address from BigMailBox.com.
Hundreds of choices. It's free!
http://www.bigmailbox.com
-

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




Re: [PHP-DB] PHP and HTML problems

2002-03-22 Thread Bzdpltd

The file did not attach to the problem I asked for earlier. Here is what I need below:
HI People,

I do not use dreamweaver normally, but have to do a few changes and add some
php code to this site.

I wonder if someone could quickly look at the attached php page, and look at
the navigation i use and see why it is looping within the html. Basically I
need the records to look but not the next and previous section for the
navigation. 

If someone could let me know where I am going wrong, as its urgent. It is the
html formatting that I think I cannot quite get to grips with. 

Thanks

Barry

Here is the file below

***




In Press Technical Marketing: Client List

p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt}
li {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt}
td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt}









   
 
  







  
  
  

  
  
  
  
  
  
   
 
 
   
  
  


  
  
  
  
   

   
Here are the results of your search: [ back to search ]
  
\n");
echo ("\n");
echo ("\n");

$count = 1; 
$numcols = 3; 
$limit = 2; 

if ($industry_area != "") :
$sqlcount= "SELECT * FROM clients WHERE ('$industry_area' = industry_area) ORDER BY 
clientname DESC";

elseif ($clientname != "") :
$sqlcount= "SELECT * FROM clients WHERE ('$clientname' = clientname) ORDER BY 
clientname DESC";

elseif ($number != "") :
$sqlcount= "SELECT * FROM press_release WHERE ('$number' = number) ORDER BY clientname 
DESC";


endif;


$sql_countresult = mysql_query($sqlcount); 
$totalrows = mysql_num_rows($sql_countresult); 

if(empty($page)){ 
$page = 1; 
} 

$limitvalue1 = $page*$limit-($limit); 

if ($industry_area != "") :
$sql= "SELECT * FROM clients WHERE ('$industry_area' = industry_area) ORDER BY 
clientname DESC LIMIT $limitvalue1, $limit";

elseif ($clientname != "") :
$sql= "SELECT * FROM clients WHERE ('$clientname' = clientname) ORDER BY clientname 
DESC LIMIT $limitvalue1, $limit";

elseif ($number != "") :
$sql= "SELECT * FROM press_release WHERE ('$number' = number) ORDER BY clientname DESC 
LIMIT $limitvalue1, $limit";

endif;

$sql_result = mysql_query($sql); 

if (mysql_num_rows($sql_result) ==0)
{

echo ("Sorry No results found\n");


} else {

while ($row = mysql_fetch_array($sql_result)){
echo ("  \n");
echo ("  \n");
echo ("   Name\n");
echo ("  \n");
echo ("   $row[clientname]\n");
echo ("  \n");
echo ("\n");
echo ("   Yrs With Inpress\n");
echo ("$row[years_at_inpress]\n");
echo ("   \n");
echo ("\n");
echo (" Press Releases\n");
echo (" View Press 
Realeases\n");
echo ("   \n");
echo ("\n");
echo (" Case Studies\n");
echo (" View Case 
Studies\n");
echo ("   \n");
?>
   

  


 PREV "; // if page is not equal to one, prev goes to $page - 1 
} 
else { 

} 
$numofpages = $totalrows/$limit; 

for($i= 1; $i < $numofpages; $i++) { 
if($page == $i) { 
echo " $i "; //make number 
navigation 
} 
else{ 
echo "
 $i "; //make number navigation 
} 
} 

if($totalrows%$limit != 0) { 
if($page > $numofpages) { 
echo " $i "; //make number 
navigation 
} 
else{ 
echo "
 $i "; if there is a remainder, add another page 

} 
} 

if(($totalrows-($limit*$page)) > 0){ 
$pagenext = $page + 1; 
echo "NEXT
 "; // if the totalrows - $limit * $page is > 0 (meaning there is a 
remainder), leave the next button. 
} 

}
}
mysql_free_result($sql_result);
?>

  

  
 
  
  

  
  




  
  






  

 
  
  
  
  



  


  
  
  
  
  
  
  




**

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




Re: [PHP-DB] Relational database

2002-03-22 Thread Cirstoiu Aurel Sorin

test



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




Re: [PHP-DB] Relational database

2002-03-22 Thread Andrey Hristov

Otidi tuk : http://www.php.net/unsub.php i vig kak se pravi Unsubscribe

Andrey

- Original Message - 
From: "Stefan" <[EMAIL PROTECTED]>
To: "'Andrey Hristov'" <[EMAIL PROTECTED]>; "'Ron'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 10:37 AM
Subject: RE: [PHP-DB] Relational database


> Dear friends at [EMAIL PROTECTED],
> 
> I am an innocent guy from Bulgaria and somehow I got in to your mailing
> list ([EMAIL PROTECTED] & [EMAIL PROTECTED]). Now I got all of your
> mails and I am sure this is a mistake.
> 

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


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