[PHP-DB] php linux + micorsoft sql server
Whatever the way I compile apache or freetds or php the error message is still the same Call to undefined function : sybase_connect (the same for mssql_connect) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Counting db generate links
You use a link management system. You can find examples of these all around the web, but I know you can get some at http://www.hotscripts.com They are also probably more complex and flexible than what i describe below. Basically what it does (you could even write it yourself) is this: 1. All links point to a redirect.php script with a URL like the following. - eg.1.http://www.domain.com/redirect.php?URL=http://www.otherdomain.com/place. htm OR - eg.2 http://www.domain.com/redirect.php?link=432 Depending on which way you choose, the link=432 will search a database with link 432 and send the user to that appropriate page. 2. To redirect the user (for eg.1) all is needed is redirect.php to contain the following code - eg. - before this line is called however you need to insert the url (and maybe date/time/referring page etc aswell) into the database. 3. When you want to display the data, all you need to do is filter the results and sum up the totals as necessary. If you store the code the following way it seems much more flexible. 3/12/02 5:36PM http://www.domain.com/ http://www.referringdomain.com/page.htm 3/12/02 8:44PM http://www.domain2.co.uk/place.htm http://www.referringdomain. com/page2.htm 3/13/02 7:26AM http://www.domain.com/ http://www.referringdomain.com/page.htm Cause you only have to do one sql statement (a quick insert, rather than a select and update, etc) and then you can collate all data on a different page, and provide comprehensive results. Another link system (like eg.2 up above) would involve the database a lot more, by connecting to the database and selecting certain links, then updating, etc. this is would be good if you were storing addresses (like downloadable things, eg PDFs or scripts, etc) cause then it really is a link MANAGEMENT system, and not just a link stat counter Adam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Image Operations with MySQL
http://www.phpbuilder.com/columns/florian19991014.php3 "Tim Lan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I want to save and load images as binaries with a MySQL database, but I'm > not sure how to do it. I'm sure this is a very dumb question, but forgive > me for being a newbie =) > > > Tim > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: FIle Uploading to database
"Todd Williamsen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Well... thanks to Dan Burner for the script... BUT > > I cannot get this friggin INSERT statement to execute.. which craps out.. Specific error messages might help more. Use mysql_error() with die() more to get them. > I cannot figure it out. I have been staring at it for about an hour and I > still cannot figure it out > > here it is: > > $db = @mysql_select_db($db_name, $connection) or die("Could not select > database"); > $query = "INSERT INTO Canidate(FirstName, LastName, Industry, Address1, > Address2, City, State, Zip, LocationPref, Phone, Email, ResumeUp) VALUES > ('$FirstName', '$LastName', '$Industry' '$Address1', 'Address2', '$City', > '$State', '$Zip', '$LocationPref', '$Phone', '$Email', '$ResumeUp2')"; > $result = @mysql_query($query, $connection) or die("could not execute > query"); > $pat = array("#", "@", "*", "&", "%", "@","$","'","`"); > $w= '_'; > $ResumeUp2 = str_replace ($pat, $w, stripslashes($ResumeUp)); > exec("cp '$ResumeUp' '/resumes/$ResumeUp2'"); > ?> > > it errors out on the $result "could not execute query" > > Let me know if you need more info! > > Thank you! > > > "Todd Williamsen" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I don't want the file to be stored in the database, but its location. > > > > What I want to do: > > > > Upload a file, it gets stored on the webserver, but its location on the > > server is stored in the database. > > > > Where do I look for something like this? > > > > What data type would I use to store the URL or file location? > > > > Thank you > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] cutting off zeros >> 10.00 to 10
Hallo, i was wondering if there is a built-in function in php that just cuts off not needed zeros from float-numbers (like changing "1.90" to "1.9" or "10.00" to "10"). I get this numbers from a mysql-database, perhaps there even is a mysql-function for this??? thank you very much, Thomas Murphy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] cutting off zeros >> 10.00 to 10
I tested this and it seems to work: $n = 1.90; for($i=strlen($n);$i<0;$i--){ if(substr($n,$i,1) == "0"){ $n = substr($n,0,(strlen($n))-1); }else{ break; } } No charge...this time. =) Regards, Mike - Original Message - From: "Thomas Murphy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 5:12 AM Subject: [PHP-DB] cutting off zeros >> 10.00 to 10 > Hallo, > > i was wondering if there is a built-in function in php that just cuts > off not needed zeros from float-numbers (like changing "1.90" to "1.9" > or "10.00" to "10"). > I get this numbers from a mysql-database, perhaps there even is a > mysql-function for this??? > > thank you very much, > Thomas Murphy > > -- > 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] cutting off zeros >> 10.00 to 10
Whoops, had a little typo in there. $n = substr($n,0,(strlen($n))-1); should be $n = substr($n,0,(strlen($n)-1)); Mike - Original Message - From: "Mike Maltese" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 5:58 AM Subject: Re: [PHP-DB] cutting off zeros >> 10.00 to 10 > I tested this and it seems to work: > > $n = 1.90; > > for($i=strlen($n);$i<0;$i--){ > if(substr($n,$i,1) == "0"){ > $n = substr($n,0,(strlen($n))-1); > }else{ > break; > } > } > > No charge...this time. =) > > Regards, > Mike > - Original Message - > From: "Thomas Murphy" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, February 06, 2002 5:12 AM > Subject: [PHP-DB] cutting off zeros >> 10.00 to 10 > > > > Hallo, > > > > i was wondering if there is a built-in function in php that just cuts > > off not needed zeros from float-numbers (like changing "1.90" to "1.9" > > or "10.00" to "10"). > > I get this numbers from a mysql-database, perhaps there even is a > > mysql-function for this??? > > > > thank you very much, > > Thomas Murphy > > > > -- > > 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] cutting off zeros >> 10.00 to 10
Hello Mike, Mike Maltese wrote: > > I tested this and it seems to work: > > $n = 1.90; > > for($i=strlen($n);$i<0;$i--){ > if(substr($n,$i,1) == "0"){ > $n = substr($n,0,(strlen($n))-1); > }else{ > break; > } > } > > No charge...this time. =) thank you very much. :) bye, Thomas Murphy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Simple Search Function
Hi guys, I was wondering what the best way would be for me to do a search. The users have 2 options for tables and either can do keyword or exact matching. Right now I'm using REGEXP to do the work of the searching, only problem is that it is case sensitive. We are currently running MySQL 2.23.32 and have php 4 installed. I'm using the search with 5 different fields/columns in one table and 2 fields/columsn in another. Thanks for you help. TIA, Mike
Re: [PHP-DB] cutting off zeros >> 10.00 to 10
i still have some problems on typecasting my float-variable to a string variable. i used something like this: $n = $row["Points"]; settype($n,"string"); but the zeros are still there - as if $n is still handled as a float number not a string. with $n = 1.90 it's converted to 1.9 without problems... bye, Thomas Murphy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] sybase or SQL Server
You need to enable the MSSQL modules in php.ini or when you compile PHP. -- William Fong - [EMAIL PROTECTED] Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #: 805.490.7732| Wireless E-mail: [EMAIL PROTECTED] - Original Message - From: "ip" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 05, 2002 4:43 AM Subject: [PHP-DB] sybase or SQL Server > whatever the way I compile php,apache I have always the same error message : > Call to undefined function: sybase_connect (or mssql_connect) > > > > > -- > 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] Updating Database problem...
I am having a problem with a script that simply updates a few fields in a database however, I am having a problem having the script to not update the database fields if the form is invalid... Here is my script, I don't want you to fix it for me unless you show me where I am going wrong or can point me to a good tutorial on this type of function. Thanks in advance, Jas "; $formerr = $formerr + 1; } if($s_addy == "") { $s_addyerr = "Please enter your Street Address"; $formerr = $formerr + 1; } if($city == "") { $cityerr = "Please enter your City"; $formerr = $formerr + 1; } if($state == "") { $stateerr = "Please enter your State"; $formerr = $formerr + 1; } if($zip == "") { $ziperr = "Please enter your Zip Code"; $formerr = $formerr + 1; } if($phone == "") { $phoneerr = "Please enter your Phone Number"; $formerr = $formerr + 1; } # - connects to the mysql database to edit information $db_name = "test"; $table_name = "www_demo"; $connection = @mysql_connect("localhost", "user", "password") or die ("Could not connect to database. Please try again later."); $db = @mysql_select_db("$db_name",$connection) or die ("Could not select database table. Please try again later."); $sql = "UPDATE $table_name SET c_name=\"$c_name\",s_addy=\"$s_addy\",city=\"$city\",state=\"state\",zip=\"z ip\",phone=\"$phone\""; $result = @mysql_query($sql, $connection) or die ("Could not execute query. Please try again later."); # -- ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Updating Database problem...
Jas, Why are you initiating an UPDATE command when you've not changed the information you wish to update? For instance, if $c_name is blank, you display a message to enter the data; yet, you DO NOT ASK the user to enter the correct information. Then, you do an UPDATE statment to enter that blank info into the record. You also update $formerr, yet do not use it. I've got a feeling you're not sharing all your code. Please do so if we are to help. You also need a WHERE clause in you UPDATE; otherwise, ALL records will be changed -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 11:14 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Updating Database problem... I am having a problem with a script that simply updates a few fields in a database however, I am having a problem having the script to not update the database fields if the form is invalid... Here is my script, I don't want you to fix it for me unless you show me where I am going wrong or can point me to a good tutorial on this type of function. Thanks in advance, Jas "; $formerr = $formerr + 1; } if($s_addy == "") { $s_addyerr = "Please enter your Street Address"; $formerr = $formerr + 1; } if($city == "") { $cityerr = "Please enter your City"; $formerr = $formerr + 1; } if($state == "") { $stateerr = "Please enter your State"; $formerr = $formerr + 1; } if($zip == "") { $ziperr = "Please enter your Zip Code"; $formerr = $formerr + 1; } if($phone == "") { $phoneerr = "Please enter your Phone Number"; $formerr = $formerr + 1; } # - connects to the mysql database to edit information $db_name = "test"; $table_name = "www_demo"; $connection = @mysql_connect("localhost", "user", "password") or die ("Could not connect to database. Please try again later."); $db = @mysql_select_db("$db_name",$connection) or die ("Could not select database table. Please try again later."); $sql = "UPDATE $table_name SET c_name=\"$c_name\",s_addy=\"$s_addy\",city=\"$city\",state=\"state\",zip=\"z ip\",phone=\"$phone\""; $result = @mysql_query($sql, $connection) or die ("Could not execute query. Please try again later."); # -- ?> -- 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] Is this possible?
Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the "product table" and two rows from the "price table" in one line in a page? Is it possible? Best regards Raymond -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Is this possible?
Yes, you can do that easily. It is easier to answer your question if you show us your table structure. -Original Message- From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 11:16 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Is this possible? Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the "product table" and two rows from the "price table" in one line in a page? Is it possible? Best regards Raymond -- 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] Updating Database problem...
Sorry, but I figured it out. You were right, I do need to call the sql update function after the error field returns a 0. Here is the code if any one else out there is having the same problem. "; $formerr = $formerr + 1; } if($s_addy == "") { $s_addyerr = "Please enter your Street Address"; $formerr = $formerr + 1; } if($city == "") { $cityerr = "Please enter your City"; $formerr = $formerr + 1; } if($state == "") { $stateerr = "Please enter your State"; $formerr = $formerr + 1; } if($zip == "") { $ziperr = "Please enter your Zip Code"; $formerr = $formerr + 1; } if($phone == "") { $phoneerr = "Please enter your Phone Number"; $formerr = $formerr + 1; } ?> - Then in body of document -- 0) { print('You need to fill out the form completely. Click the back button on your browser to make the necessary changes.'); echo $c_nameerr; echo $s_addyerr; echo $cityerr; echo $stateerr; echo $ziperr; echo $phoneerr; } if($formerr == 0) { print("Your changes have been saved to the database"); # - connects to the mysql database to edit information $db_name = "test"; $table_name = "www_demo"; $connection = @mysql_connect("localhost", "user", "password") or die ("Could not connect to database. Please try again later."); $db = @mysql_select_db("$db_name",$connection) or die ("Could not select database table. Please try again later."); $sql = "UPDATE $table_name SET c_name=\"$c_name\",s_addy=\"$s_addy\",city=\"$city\",state=\"state\",zip=\"z ip\",phone=\"$phone\""; $result = @mysql_query($sql, $connection) or die ("Could not execute query. Please try again later."); # -- } ?> "Rick Emery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Jas, > > Why are you initiating an UPDATE command when you've not changed the > information you wish to update? > For instance, if $c_name is blank, you display a message to enter the data; > yet, you DO NOT ASK the user to enter the correct information. Then, you do > an UPDATE statment to enter that blank info into the record. > > You also update $formerr, yet do not use it. > > I've got a feeling you're not sharing all your code. Please do so if we are > to help. > > You also need a WHERE clause in you UPDATE; otherwise, ALL records will be > changed > > -Original Message- > From: jas [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 11:14 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Updating Database problem... > > > I am having a problem with a script that simply updates a few fields in a > database however, I am having a problem having the script to not update the > database fields if the form is invalid... Here is my script, I don't want > you to fix it for me unless you show me where I am going wrong or can point > me to a good tutorial on this type of function. Thanks in advance, > Jas > # trim extra spaces from these variables > $c_name = trim($c_name); > $s_addy = trim($s_addy); > $city = trim($city); > $state = trim($state); > $zip = trim($zip); > $phone = trim($phone); > if($c_name == "") > { >$c_nameerr = "Please enter your Company Name"; >$formerr = $formerr + 1; > > } > if($s_addy == "") > { >$s_addyerr = "Please enter your Street Address"; >$formerr = $formerr + 1; > > } > if($city == "") > { >$cityerr = "Please enter your City"; >$formerr = $formerr + 1; > > } > if($state == "") > { >$stateerr = "Please enter your State"; >$formerr = $formerr + 1; > > } > if($zip == "") > { >$ziperr = "Please enter your Zip Code"; >$formerr = $formerr + 1; > > } > if($phone == "") > { >$phoneerr = "Please enter your Phone Number"; >$formerr = $formerr + 1; > > } > # - connects to the mysql database to edit information > $db_name = "test"; > $table_name = "www_demo"; > $connection = @mysql_connect("localhost", "user", "password") or die ("Could > not connect to database. Please try again later."); > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > database table. Please try again later."); > $sql = "UPDATE $table_name SET > c_name=\"$c_name\",s_addy=\"$s_addy\",city=\"$city\",state=\"state\",zip=\"z > ip\",phone=\"$phone\""; > $result = @mysql_query($sql, $connection) or die ("Could not execute query. > Please try again later."); > # -- > ?> > > > > -- > 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] Is this possible?
My table look like this: Pricetable: (varetabell) (varenr, type, pris) VALUES (1, '6inch', 29), (1, '6inch meny', 51), (1, 'footlong', 45), (1, 'footlong meny', 66), (1, 'salat', 39), (1, 'salat meny', 51), (2, '6inch', 49), (2, '6inch meny', 69), (2, 'footlong', 75), (2, 'footlong meny', 96), (2, 'salat', 49), (2, 'salat meny', 69), Product table: (pristabell) --- (varenr, varenavn, innhold) VALUES ('1','Veggie Delite','Grønnsaker og ost'), ('2','Subway Club', 'Kalkun, skinke og roasbeef'), ('3','Classic Italian BMT', 'Skinke, salami og pepperoni'), And the query that I have tried looks like this: SELECT varetabell.varenavn, varetabell.varenr, varetabell.innhold, pristabell.pris FROM varetabell, pristabell WHERE pristabell.varenr=varetabell.varenr AND pristabell.type='6inch' AND pristabell.type='footlong' - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: "'Raymond Lilleodegard'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 6:23 PM Subject: RE: [PHP-DB] Is this possible? > Yes, you can do that easily. > > It is easier to answer your question if you show us your table structure. > > -Original Message- > From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 06, 2002 11:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Is this possible? > > > Hi! > > I have this tricky case, at lest for me : ) > > I'm trying to get some data out of two tables and listing the data in a > product/price site. But. : > > I have one table with productinfo and one with prices. > And it is several columns with the same id in the pricetable, because every > product have several sizes. > > So... how do I get only one row from the "product table" and two rows from > the "price table" in one line in a page? > Is it possible? > > > > Best regards > > Raymond > > > > -- > 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] Is this possible?
Hi Raymond, > I have this tricky case, at lest for me : ) > > I'm trying to get some data out of two tables and listing the data in a > product/price site. But. : > > I have one table with productinfo and one with prices. > And it is several columns with the same id in the pricetable, because every > product have several sizes. > > So... how do I get only one row from the "product table" and two rows from > the "price table" in one line in a page? > Is it possible? No, not as such. Code one query to do the join and SELECT the data, grouped and ordered by (say) ProdCode and within that PackSize. Then use PHP to cycle (outer loop) though each product (group), continuing the 'output' across the line when consecutive records are for the same ProdCode (but not re-displaying the ProductInfo data). Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Updating Database problem...
What is the error? We have no idea what to look for if you don't tell us what error you are receiving. Have you (like someone else has suggested earlier) printed the SQL statement? I would add: print( '' ); in your code after you build the statement. In your SQL statement, shouldn't it be state=\"$state\" and zip=\"$zip\"? -- > $sql = "UPDATE $table_name SET > c_name=\"$c_name\",s_addy=\"$s_addy\",city=\"$city\",state=\"state\",zip=\"z > ip\",phone=\"$phone\""; -- Also, I would suggest putting: print("Your changes have been saved to the database"); after the query has ACTUALLY finished. That way if for some reason it didn't work, your visitor doesn't feel "Well, you told me it was completed! Why isn't???". Like if the DB server was down or something. -- William Fong - [EMAIL PROTECTED] Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #: 805.490.7732| Wireless E-mail: [EMAIL PROTECTED] - Original Message - From: "jas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 31, 2002 9:41 PM Subject: Re: [PHP-DB] Updating Database problem... > Sorry, but I figured it out. You were right, I do need to call the sql > update function after the error field returns a 0. Here is the code if any > one else out there is having the same problem. > # trim extra spaces from these variables > $c_name = trim($c_name); > $s_addy = trim($s_addy); > $city = trim($city); > $state = trim($state); > $zip = trim($zip); > $phone = trim($phone); > if($c_name == "") > { >$c_nameerr = "Please enter your Company Name"; >$formerr = $formerr + 1; > > } > if($s_addy == "") > { >$s_addyerr = "Please enter your Street Address"; >$formerr = $formerr + 1; > > } > if($city == "") > { >$cityerr = "Please enter your City"; >$formerr = $formerr + 1; > > } > if($state == "") > { >$stateerr = "Please enter your State"; >$formerr = $formerr + 1; > > } > if($zip == "") > { >$ziperr = "Please enter your Zip Code"; >$formerr = $formerr + 1; > > } > if($phone == "") > { >$phoneerr = "Please enter your Phone Number"; >$formerr = $formerr + 1; > > } > ?> > - Then in body of document -- > > if($formerr > 0) > { > print('You need to fill out the form completely. Click the back button on > your browser to make the necessary changes.'); > echo $c_nameerr; > echo $s_addyerr; > echo $cityerr; > echo $stateerr; > echo $ziperr; > echo $phoneerr; > } > > if($formerr == 0) > { > print("Your changes have been saved to the database"); > # - connects to the mysql database to edit information > $db_name = "test"; > $table_name = "www_demo"; > $connection = @mysql_connect("localhost", "user", "password") or die ("Could > not connect to database. Please try again later."); > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > database table. Please try again later."); > $sql = "UPDATE $table_name SET > c_name=\"$c_name\",s_addy=\"$s_addy\",city=\"$city\",state=\"state\",zip=\"z > ip\",phone=\"$phone\""; > $result = @mysql_query($sql, $connection) or die ("Could not execute query. > Please try again later."); > # -- > } > ?> > "Rick Emery" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Jas, > > > > Why are you initiating an UPDATE command when you've not changed the > > information you wish to update? > > For instance, if $c_name is blank, you display a message to enter the > data; > > yet, you DO NOT ASK the user to enter the correct information. Then, you > do > > an UPDATE statment to enter that blank info into the record. > > > > You also update $formerr, yet do not use it. > > > > I've got a feeling you're not sharing all your code. Please do so if we > are > > to help. > > > > You also need a WHERE clause in you UPDATE; otherwise, ALL records will be > > changed > > > > -Original Message- > > From: jas [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 31, 2002 11:14 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] Updating Database problem... > > > > > > I am having a problem with a script that simply updates a few fields in a > > database however, I am having a problem having the script to not update > the > > database fields if the form is invalid... Here is my script, I don't want > > you to fix it for me unless you show me where I am going wrong or can > point > > me to a good tutorial on this type of function. Thanks in advance, > > Jas > > > # trim extra spaces from these variables > > $c_name = trim($c_name); > > $s_addy = trim($s_addy); > > $city = trim($city); > > $state = trim($state); > > $zip = trim($zip); > > $phone = trim($phone); > > if($c_name == "") > > { > >$c_nameerr = "Please enter your Company Name"; > >$formerr = $formerr + 1; > > > > } > > if($s_addy == "") > > { > >$s_addyerr = "Please enter your Street Address"; > >$formerr = $formerr +
[PHP-DB] Search results
I have done a search page based on a specific column name, but in some columns there is no results to be returned.. What I would like to do is display an error message stating that there is no results .. something like "Sorry your search returned Zero Rows" = Here is my code: "; while ($row = mysql_fetch_array($result)) { $id = $row["id"]; $FirstName = $row["FirstName"]; $LastName = $row["LastName"]; $contact_list .="$LastName, $FirstName"; } $contact_list .=""; $msg = "Sorry, Your Search Results Returned Zero Records"; ?> Your Search Results Your Search Results for " " == this is the code block that is stumping me Go Back to Main Menu == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Is this possible?
It looks to me like you should be dividing the data differently; something like (quantity, item, option, price) VALUES (1, '6inch', '', '29), (1, '6inch', 'meny', 51), (1, 'footlong', '', 45), (1, 'footlong', 'meny', 66), and so forth... "Raymond lilleødegård" <[EMAIL PROTECTED]> wrote in message 001d01c1af34$621b96e0$31c7d450@amd">news:001d01c1af34$621b96e0$31c7d450@amd... > My table look like this: > > Pricetable: (varetabell) > > (varenr, type, pris) > VALUES > (1, '6inch', 29), > (1, '6inch meny', 51), > (1, 'footlong', 45), > (1, 'footlong meny', 66), > (1, 'salat', 39), > (1, 'salat meny', 51), > (2, '6inch', 49), > (2, '6inch meny', 69), > (2, 'footlong', 75), > (2, 'footlong meny', 96), > (2, 'salat', 49), > (2, 'salat meny', 69), -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mail options
Can any one tell me what the value of using this statement. mail($email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion()); vs this statement mail($recipient, $subject, $msg, $mailheaders); considering all variables are defind in the script
Re: [PHP-DB] Is this possible?
Raymond, See complaint elsewhere as a result of cross-posting. Add my criticism because I'm on both lists and keep them in separate InBox folders and now feeling schizoid... SELECT * [whatever] FROM pristabell P, varetabell V1, varetabell V2 WHERE P.varenr = V1.varenr AND P.varenr = V2.varenr AND V2.type = concat(V1.type, " meny") [sorry, machine is busy on something, so haven't prototyped it] The last AND condition might have to move to a HAVING clause. This conditional on the larger product always being called name + " meny" - absolutely NOT a good idea! Alternative: AND V2.pris > V1.pris (better than what I said before) Have you tried any of these? Please advise, =dn > Pricetable: (varetabell) > > (varenr, type, pris) > VALUES > (1, '6inch', 29), > (1, '6inch meny', 51), > (1, 'footlong', 45), > (1, 'footlong meny', 66), > (1, 'salat', 39), > (1, 'salat meny', 51), > (2, '6inch', 49), > (2, '6inch meny', 69), > (2, 'footlong', 75), > (2, 'footlong meny', 96), > (2, 'salat', 49), > (2, 'salat meny', 69), > > > Product table: (pristabell) > --- > (varenr, varenavn, innhold) > VALUES > ('1','Veggie Delite','Grønnsaker og ost'), > ('2','Subway Club', 'Kalkun, skinke og roasbeef'), > ('3','Classic Italian BMT', 'Skinke, salami og pepperoni'), > > > > And the query that I have tried looks like this: > > SELECT varetabell.varenavn, varetabell.varenr, varetabell.innhold, > pristabell.pris FROM varetabell, pristabell WHERE > pristabell.varenr=varetabell.varenr AND pristabell.type='6inch' AND > pristabell.type='footlong' > > > > - Original Message - > From: "Rick Emery" <[EMAIL PROTECTED]> > To: "'Raymond Lilleodegard'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, February 06, 2002 6:23 PM > Subject: RE: [PHP-DB] Is this possible? > > > > Yes, you can do that easily. > > > > It is easier to answer your question if you show us your table structure. > > > > -Original Message- > > From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, February 06, 2002 11:16 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] Is this possible? > > > > > > Hi! > > > > I have this tricky case, at lest for me : ) > > > > I'm trying to get some data out of two tables and listing the data in a > > product/price site. But. : > > > > I have one table with productinfo and one with prices. > > And it is several columns with the same id in the pricetable, because > every > > product have several sizes. > > > > So... how do I get only one row from the "product table" and two rows from > > the "price table" in one line in a page? > > Is it possible? > > > > > > > > Best regards > > > > Raymond > > > > > > > > -- > > 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] Is this possible?
SELECT * FROM pristabell LEFT JOIN varetabell USING(varenr) WHERE pristabell.varenr=$item This statement will get all prices and quantities fro a given item ($item). Simply interate through the recordset and display the info in whatever format you wish. -Original Message- From: Raymond Lilleødegård [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 11:33 AM To: Rick Emery; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Is this possible? My table look like this: Pricetable: (varetabell) (varenr, type, pris) VALUES (1, '6inch', 29), (1, '6inch meny', 51), (1, 'footlong', 45), (1, 'footlong meny', 66), (1, 'salat', 39), (1, 'salat meny', 51), (2, '6inch', 49), (2, '6inch meny', 69), (2, 'footlong', 75), (2, 'footlong meny', 96), (2, 'salat', 49), (2, 'salat meny', 69), Product table: (pristabell) --- (varenr, varenavn, innhold) VALUES ('1','Veggie Delite','Grønnsaker og ost'), ('2','Subway Club', 'Kalkun, skinke og roasbeef'), ('3','Classic Italian BMT', 'Skinke, salami og pepperoni'), And the query that I have tried looks like this: SELECT varetabell.varenavn, varetabell.varenr, varetabell.innhold, pristabell.pris FROM varetabell, pristabell WHERE pristabell.varenr=varetabell.varenr AND pristabell.type='6inch' AND pristabell.type='footlong' - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: "'Raymond Lilleodegard'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 6:23 PM Subject: RE: [PHP-DB] Is this possible? > Yes, you can do that easily. > > It is easier to answer your question if you show us your table structure. > > -Original Message- > From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 06, 2002 11:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Is this possible? > > > Hi! > > I have this tricky case, at lest for me : ) > > I'm trying to get some data out of two tables and listing the data in a > product/price site. But. : > > I have one table with productinfo and one with prices. > And it is several columns with the same id in the pricetable, because every > product have several sizes. > > So... how do I get only one row from the "product table" and two rows from > the "price table" in one line in a page? > Is it possible? > > > > Best regards > > Raymond > > > > -- > 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] Re: Simple Search Function
Hi there, you might want to take a look at the eregi function for case-insensitive pattern matching. Joe :) "Mike De Libero" <[EMAIL PROTECTED]> wrote in message 001f01c1af1c$4d7dce00$6901a8c0@slugo">news:001f01c1af1c$4d7dce00$6901a8c0@slugo... Hi guys, I was wondering what the best way would be for me to do a search. The users have 2 options for tables and either can do keyword or exact matching. Right now I'm using REGEXP to do the work of the searching, only problem is that it is case sensitive. We are currently running MySQL 2.23.32 and have php 4 installed. I'm using the search with 5 different fields/columns in one table and 2 fields/columsn in another. Thanks for you help. TIA, Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Search results
On Thursday 07 February 2002 02:16, Todd Williamsen wrote: > I have done a search page based on a specific column name, but in some > columns there is no results to be returned.. > > What I would like to do is display an error message stating that there is > no results .. something like "Sorry your search returned Zero Rows" > = > Here is my code: > > $connection = @mysql_connect($databaseserver, $databaseuser, $databasepass) > or die("Can't connect to DB"); > $db = @mysql_select_db($databasename, $connection) or die("could not select > DB"); > $sql = "SELECT id, FirstName, LastName FROM Canidate WHERE Industry = > \"$Industry\""; > $result = @mysql_query($sql, $connection) or die("could not execute > query"); > > $contact_list = ""; > while ($row = mysql_fetch_array($result)) { $FOUND_SOMETHING = 1; > $id = $row["id"]; > $FirstName = $row["FirstName"]; > $LastName = $row["LastName"]; > $contact_list .="$LastName, > $FirstName"; > } > $contact_list .=""; > $msg = "Sorry, Your Search Results > Returned Zero Records"; > ?> > > > > Your Search Results > > > > > Your Search > Results > for " > > " > == this is the code block that is stumping me > if ($FOUND_SOMETHING) { echo "$contact_list"; } else { echo "$msg"; > } > ?> > > Go > Back to Main Menu > > > == hth -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Lonely is a man without love. -- Englebert Humperdinck */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Is this possible?
I was thinking something similar, but I couldn't figure out what it meant (was it in German?). Why would you need quantity as a field? If buying two, you get a 10% discount, why not put that in a formula? Would make it a little more dynamic. Without knowing all the information: (id, item_name, price, option, option_cost, quantity_discount) ? -- William Fong - [EMAIL PROTECTED] Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #: 805.490.7732| Wireless E-mail: [EMAIL PROTECTED] - Original Message - From: "Hugh Bothwell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 10:00 AM Subject: Re: [PHP-DB] Is this possible? > It looks to me like you should be dividing the data differently; something > like > > (quantity, item, option, price) > VALUES > (1, '6inch', '', '29), > (1, '6inch', 'meny', 51), > (1, 'footlong', '', 45), > (1, 'footlong', 'meny', 66), > > and so forth... > > > "Raymond lilleødegård" <[EMAIL PROTECTED]> wrote in message > 001d01c1af34$621b96e0$31c7d450@amd">news:001d01c1af34$621b96e0$31c7d450@amd... > > My table look like this: > > > > Pricetable: (varetabell) > > > > (varenr, type, pris) > > VALUES > > (1, '6inch', 29), > > (1, '6inch meny', 51), > > (1, 'footlong', 45), > > (1, 'footlong meny', 66), > > (1, 'salat', 39), > > (1, 'salat meny', 51), > > (2, '6inch', 49), > > (2, '6inch meny', 69), > > (2, 'footlong', 75), > > (2, 'footlong meny', 96), > > (2, 'salat', 49), > > (2, 'salat meny', 69), > > > > > -- > 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] Storing the Database Password
Hello, I am wondering what methods you all have come up with for storing your database password. In the past, I have just been putting all of the DB connection information in an included file. Although the idea of the DB password sitting on the server in plain text makes me feel uneasy. Any suggestions on how to secure the database password would be greatly appreciated. Thanks in advance! Tim Haak -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Search results
that doesn't work "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Thursday 07 February 2002 02:16, Todd Williamsen wrote: > > I have done a search page based on a specific column name, but in some > > columns there is no results to be returned.. > > > > What I would like to do is display an error message stating that there is > > no results .. something like "Sorry your search returned Zero Rows" > > = > > Here is my code: > > > > > $connection = @mysql_connect($databaseserver, $databaseuser, $databasepass) > > or die("Can't connect to DB"); > > $db = @mysql_select_db($databasename, $connection) or die("could not select > > DB"); > > $sql = "SELECT id, FirstName, LastName FROM Canidate WHERE Industry = > > \"$Industry\""; > > $result = @mysql_query($sql, $connection) or die("could not execute > > query"); > > > > $contact_list = ""; > > while ($row = mysql_fetch_array($result)) { > > $FOUND_SOMETHING = 1; > > > $id = $row["id"]; > > $FirstName = $row["FirstName"]; > > $LastName = $row["LastName"]; > > $contact_list .="$LastName, > > $FirstName"; > > } > > $contact_list .=""; > > $msg = "Sorry, Your Search Results > > Returned Zero Records"; > > ?> > > > > > > > > Your Search Results > > > > > > > > > > Your Search > > Results > > for " > > > > " > > == this is the code block that is stumping me > > > if ($FOUND_SOMETHING) { > echo "$contact_list"; } > else { > echo "$msg"; > > } > > ?> > > > > Go > > Back to Main Menu > > > > > > == > > > hth > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > /* > Lonely is a man without love. > -- Englebert Humperdinck > */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Search results
On Wed, 6 Feb 2002, Todd Williamsen wrote: > that doesn't work Bit terse? What do you get? Error? Nothing? -- Jason Wong -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Search results
On Wed, 6 Feb 2002, Todd Williamsen wrote: Please keep discussion on the list. > Doesn't execute the $msg variable. And it doesn't return any results: Have you checked that your query does indeed return results? > I tried this: > > if ($result == 0) { > echo "$msg"; > } > else { > echo "$contact_list"; > } > ?> > But that returns the $msg variable even if there is results $result as defined in your code (see manual on mysql_query() for full details) will be FALSE if your query does not get executed correctly. If your query executes correctly $result will contain a link identifier. However that doesn't necessarily mean that your query returned any *results*. Insert some echos in your while loop to see whether you have any results. -- Jason Wong -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Search results
CHANGE: TO: if( mysql_num_rows($result) > 0 ) { echo "$contact_list"; } else { echo "$msg"; } -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 12:17 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Search results I have done a search page based on a specific column name, but in some columns there is no results to be returned.. What I would like to do is display an error message stating that there is no results .. something like "Sorry your search returned Zero Rows" = Here is my code: "; while ($row = mysql_fetch_array($result)) { $id = $row["id"]; $FirstName = $row["FirstName"]; $LastName = $row["LastName"]; $contact_list .="$LastName, $FirstName"; } $contact_list .=""; $msg = "Sorry, Your Search Results Returned Zero Records"; ?> Your Search Results Your Search Results for " " == this is the code block that is stumping me Go Back to Main Menu == -- 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] RE: Search results
You can use mysql_result_rows() to check whether any rows were returned; something like: 0){ while ($row = mysql_fetch_array($result)) { //Do stuff with result rows here } }else{ echo "Sorry your search returned Zero Rows"; } ?> HTH, -Andy > -Original Message- > From: Todd Williamsen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 06, 2002 10:17 AM > To: [EMAIL PROTECTED] > Subject: Search results > > > I have done a search page based on a specific column name, but in some > columns there is no results to be returned.. > > What I would like to do is display an error message stating that > there is no > results .. something like "Sorry your search returned Zero Rows" > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] RE: Search results
> You can use mysql_result_rows() to check whether any rows were returned; > something like: you mean: mysql_num_rows(); ? Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] RE: Search results
Yes, sorry about that. :P I need to eat lunch now. -Andy > -Original Message- > From: Chris Boget > Subject: Re: [PHP-DB] RE: Search results > you mean: > > mysql_num_rows(); > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: Simple Search Function
Mike is using MYSQL's REGEX; he's looking for a case-insensitive MYSQL function function similar to PHP's eregi(). -Original Message- From: Lerp [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 1:26 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Simple Search Function Hi there, you might want to take a look at the eregi function for case-insensitive pattern matching. Joe :) "Mike De Libero" <[EMAIL PROTECTED]> wrote in message 001f01c1af1c$4d7dce00$6901a8c0@slugo">news:001f01c1af1c$4d7dce00$6901a8c0@slugo... Hi guys, I was wondering what the best way would be for me to do a search. The users have 2 options for tables and either can do keyword or exact matching. Right now I'm using REGEXP to do the work of the searching, only problem is that it is case sensitive. We are currently running MySQL 2.23.32 and have php 4 installed. I'm using the search with 5 different fields/columns in one table and 2 fields/columsn in another. Thanks for you help. TIA, Mike -- 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] if variable is equal to 2 through 4
i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo "hello"; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? Should you have any questions, comments or concerns, feel free to call me at 318-338-2034. Thank you for your time, Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A == Bayou Internet..(888) 30-BAYOUhttp://www.bayou.com Mississippi Internet...(800) MISSISSIPPI...http://www.mississippi.net Vicksburg Online..(800) MISSISSIPPIhttp://www.vicksburg.com == Tel: (318) 338-2034ICQ: 38823829 Fax: (318) 323-5053 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] if variable is equal to 2 through 4
> how would I write it if I wanted to say this: > if $variable == 2 through 4 ??? if(( $variable >= 2 ) && ( $variable <= 4 )) { echo "Equals 2 through 4\n"; } Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] if variable is equal to 2 through 4
try this: if ($v>=2 && $v<=4) { echo "..."; } mihai On Wed, 6 Feb 2002, Jay Fitzgerald wrote: > i am currently using this code: > > if ($variable == 2) || ($variable == 3) || ($variable == 4) > { > echo "hello"; > } > > how would I write it if I wanted to say this: > > if $variable == 2 through 4 ??? > > > > Should you have any questions, comments or concerns, feel free to call me > at 318-338-2034. > > Thank you for your time, > > Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A > == > Bayou Internet..(888) > 30-BAYOUhttp://www.bayou.com > Mississippi Internet...(800) > MISSISSIPPI...http://www.mississippi.net > Vicksburg Online..(800) > MISSISSIPPIhttp://www.vicksburg.com > == > Tel: (318) 338-2034ICQ: 38823829 Fax: > (318) 323-5053 > > > -- > 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] Re: [PHP] if variable is equal to 2 through 4
On Wednesday, February 6, 2002, at 04:10 PM, Jay Fitzgerald wrote: > i am currently using this code: > > if ($variable == 2) || ($variable == 3) || ($variable == 4) > { > echo "hello"; > } > > how would I write it if I wanted to say this: > > if $variable == 2 through 4 ??? if ($variable >= 2) && ($variable <= 4) Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[Fwd: Re: [PHP-DB] if variable is equal to 2 through 4]
$my_array = array ("2", "3", "4"); if (in_array($variable, $my_array)) { echo "hello"; } Jay Fitzgerald wrote: > i am currently using this code: > > if ($variable == 2) || ($variable == 3) || ($variable == 4) > { > echo "hello"; > } > > how would I write it if I wanted to say this: > > if $variable == 2 through 4 ??? > > > > Should you have any questions, comments or concerns, feel free to call > me at 318-338-2034. > > Thank you for your time, > > Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A > == > Bayou Internet..(888) > 30-BAYOUhttp://www.bayou.com > Mississippi Internet...(800) > MISSISSIPPI...http://www.mississippi.net > Vicksburg Online..(800) > MISSISSIPPIhttp://www.vicksburg.com > == > Tel: (318) 338-2034ICQ: 38823829 > Fax: (318) 323-5053 > > -- "Out beyond the ideas of wrong-doing and right-doing there is a field. I'll meet you there." -Rumi *(O)* [EMAIL PROTECTED] *** under construction *** http://centralcoasthealing.net Healing Resources on the Central Coast http://kornsnake.com Internet Development -- "Out beyond the ideas of wrong-doing and right-doing there is a field. I'll meet you there." -Rumi *(O)* [EMAIL PROTECTED] *** under construction *** http://centralcoasthealing.net Healing Resources on the Central Coast http://kornsnake.com Internet Development -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] help files...
Is there anyone out there that has developed an application using php and mysql that allows clients etc to update and maintain their own website? And if so did you include a kind of "help" system or users guide? If so could you please enlighten me on how you went about creating it whether you used php to query a database table made for your different help sections or did you use the applet method? I am just not sure what the best option would be for this type of thing. Thanks in advance, Jas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] if variable is equal to 2 through 4
if ( ($variable > 1 ) && ($variable < 5) ) echo "hello"; or alternatively, for ($i=2; $i < 5; $i++) { if ($variable=$i) echo "hello"; } Gurhan Ozen MCI WorldCom Quality Assurance Team [EMAIL PROTECTED] ph: 703-449-4754 Vnet: 228-4754 1-800-PAGE-MCI pin: 1927052 AIM: Greywolf1923 -Original Message- From: Jay Fitzgerald [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 4:10 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] if variable is equal to 2 through 4 i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo "hello"; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? Should you have any questions, comments or concerns, feel free to call me at 318-338-2034. Thank you for your time, Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A == Bayou Internet..(888) 30-BAYOUhttp://www.bayou.com Mississippi Internet...(800) MISSISSIPPI...http://www.mississippi.net Vicksburg Online..(800) MISSISSIPPIhttp://www.vicksburg.com == Tel: (318) 338-2034ICQ: 38823829 Fax: (318) 323-5053 -- 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] Split a long db record into multiple pages
Does anyone know how to limit a long record, like a news article that has 5 > pages? > I want to limit it so it displays the first page then at the bottom it > prints: > > <<1 2 3 4 5 6 7>> > > then when you click 2 or the right arrow it displays the second page of > the record? > > Thanks > > --Will
[PHP-DB] list archive
Is there a list achrive somewhere?
Re: [PHP-DB] list archive
On 2002.02.06 19:47:12 -0600 B.J.Rumsey wrote: > Is there a list achrive somewhere? > Go here http://www.php.net/mailing-lists.php and click on the archive for the list you want. -Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] help files...
Google search for php wiki, or save that step and go to http://sourceforge.net/projects/phpwiki/ Miles Thompson At 05:26 AM 2/6/2002 -0700, jas wrote: >Is there anyone out there that has developed an application using php and >mysql that allows clients etc to update and maintain their own website? And >if so did you include a kind of "help" system or users guide? If so could >you please enlighten me on how you went about creating it whether you used >php to query a database table made for your different help sections or did >you use the applet method? I am just not sure what the best option would be >for this type of thing. Thanks in advance, >Jas > > > >-- >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] new php developer
I am a student a the University of Pittsburgh, and a new php developer. Is it possible to have a mysql database that is made up of html documents that can be accessed using php? This question may sound strange, but I'm not sure of any other way to say it. Another question I have was, is it possible to have php recognize a user, by say password or ip address, and determine which which files or links to show them. Example, say I had a user Joe. When Joe accessed the password protected directory, he would be prompted to a page where php would then recognize "Joe" and then create a list of files (links) that he would be able to access. Is php the right scripting language for this job? Thank you for your time, it is greatly appreciated. John George [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] new php developer
Hi, At 12:17 AM 2/7/2002 -0500, John George wrote: >I am a student a the University of Pittsburgh, and a new php developer. Is >it possible to have a mysql database that is made up of html documents that >can be accessed using php? This question may sound strange, but I'm not >sure of any other way to say it. Not strange, sounds like a content management system... Store the HTML in a mysql TEXT field or like... (make SURE to use addslashes() before inserting the data) >Another question I have was, is it possible to have php recognize a user, by >say password or ip address, and determine which which files or links to show >them. Example, say I had a user Joe. When Joe accessed the password >protected directory, he would be prompted to a page where php would then >recognize "Joe" and then create a list of files (links) that he would be >able to access. Sure, you need to look into session management probably... I have written a system like that from scratch, but there may be easier ways... >Is php the right scripting language for this job? DEFINITLY >Thank you for your time, it is greatly appreciated. >John George >[EMAIL PROTECTED] > -Jason Garber IonZoft.com >-- >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