[PHP] Re: PHP / mySQL Project...
Hi Don, i work for the company simplynetworks in germany. I have access to may programmers with the best quality to the best prices. We work quick and no dirty ;-) I am programmer too and my company offer you the best object oriented software of the market. Some references of my clients in Germany: DMC (Digital media center) - Neckermann (www.neckerman.de /nl/be) Shop development - 150 developer and many smoll teams. Development with PHP 4 and 5, JQuery, Prototype, CSS, XML, HTML, MYSQL and Oracle and so on. Astroshop.de (www.astroshop.de) Shop redesign and refactory. JQuery, PHP5 strong object oriented, SPL, MySQL, Zend Framework and EzComponents integration. ssc - services - Daimler Chrysler (SWAN Projekt for OFTP data transfer). PHP5 and Java, MySQL, HTML, CSS, Javascript,etc Speechconcept (linguistics) - Strong object oriented Software with DOJO, Zend Framework and many modules and very complex tasks. If you are interessing contact please to this email address. Regards Carlos Medina Don Wieland schrieb: Hello, I am needing assistance IMMEDIATELY in finishing up a project (the developer went in to have shoulder surgery and will be out of commission for 3 weeks) and I need this finished soon. Candidate must have good english skills, a solid knowledge of HTML, CSS, PHP, mySQL, Javascript, AJAX, and JQuery. Developer may work remotely. Please contact me via email, PRIVATELY, with your skills and sample of online project you have done. Also, this will be an hourly job - so what Hourly Rate you expect to get paid would be nice. Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [php] [mysql] select and subselect
Allen McCabe wrote: I have a page on my site where I can optionaly filter by certain fields (order by filesize or file category), but I am implementing a shopping cart type of idea where users can submit an order. As administrators, my coworkers and I need to be able to filter orders by their contents. For example: View all orders for Jack and the Beanstalk, where an order may have Jack and the Beanstalk and other items. I have an order table that keeps track of the order_id, the date, the status, etc. I also have an order_lineitem table that is the contents of the order. This has a one-to-many structure (without foreign keys because it is mysql). I was baffled as to how to filter the orders by the item_id that appears in the order_lineitem table. I just came up with this, but I'm not sure how the mysql_queries will handle an array. Do I have to do some extensive regular expression management here to get this to work, or will it accept an array? ?php if (isset($_POST['showid'])) $showid = $_POST['showid']; $subSQL = SELECT order_id FROM afy_show_lineitem WHERE show_id = {$_POST['showid']};; $subResult = mysql_query($subSQL); $where = WHERE; $extQuery = 'order_id = {$subResult}'; } $resultOrders = mysql_query(SELECT * FROM afy_order {$where} {$extQuery};) or die(mysql_error(Could not query the database!)); ? If $_POST['showid'] is likely to be an array, use implode to create a comma separated string of values, then use IN to build the query. $ids = implode(',', $_POST['showid']; $subSQL = SELECT order_id FROM afy_show_lineitem WHERE show_id IN ($ids) But you need also to check your logic - your query above will have two WHERE in it and will fail miserably :-) And your call to mysql_error will probably not help you either, as the (optional) argument should be a link identifier, not a string of your choosing. Cheers -- David Robley MS-DOS: celebrating ten years of obsolescence Today is Sweetmorn, the 29th day of The Aftermath in the YOLD 3175. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [php] [mysql] select and subselect
On Mon, 16 Nov 2009 14:21:41 -0800, Allen McCabe wrote: I have an order table that keeps track of the order_id, the date, the status, etc. I also have an order_lineitem table that is the contents of the order. This has a one-to-many structure (without foreign keys because it is mysql). http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html InnoDB supports foreign key constraints. ... I was baffled as to how to filter the orders by the item_id that appears in the order_lineitem table. I just came up with this, but I'm not sure how the mysql_queries will handle an array. Do I have to do some extensive regular expression management here to get this to work, or will it accept an array? ?php if (isset($_POST['showid'])) $showid = $_POST['showid']; $subSQL = SELECT order_id FROM afy_show_lineitem WHERE show_id = {$_POST['showid']};; $subResult = mysql_query($subSQL); $where = WHERE; $extQuery = 'order_id = {$subResult}'; } $resultOrders = mysql_query(SELECT * FROM afy_order {$where} {$extQuery};) or die(mysql_error(Could not query the database!)); [[ Note: You should probably have posted to the php-db list (or the php.db newsgroup) to increase the chance of getting responses from people who actually know what they're talking about. I'm a MySQL newbie... ]] $subResult is a resource. You need to fetch the results before you can use them like this. Maybe something like: /* UNTESTED */ /* Don't forget to escape! Some will argue that you are better off using prepared statements. */ $showid = mysql_real_escape_string ($_POST['showid']); $q = _ SELECT `order_id` FROM `afy_show_lineitem` WHERE `show_id` = '$showid'; _; $res = mysql_query ($q); if ($res) { while ($row = mysql_fetch_row ($res)) { $ids[] = $row[0]; /* Assuming numerical ids. */ } $ids_spec = implode (',', $ids); mysql_free_result ($res); } else { /* Handle error */ } if (isset ($ids_spec)) { $q = _ SELECT * FROM `afy_order` WHERE `order_id` IN ($ids_spec) _; $res = mysql_query ($q); if ($res) { /* Do stuff */ } else { /* Handle error */ } } But you could also do it in one query (*untested*): /* UNTESTED */ SELECT `ao`.* FROM `afy_order` AS `ao`, `afy_show_lineitem` AS `asl` WHERE `ao`.`show_id` = $show_id AND `asl`.`order_id` = `ao`.`show_id` Or maybe there are better ways, such as using INNER JOIN, but those sometimes end up using a temporary table... (Hint: php-db, php.db, php-db, ...) /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: PHP/MySQL Superstars
Thanks Manuel your input is greatly appreciated. Jerome -Original Message- From: Manuel Lemos [mailto:mle...@acm.org] Sent: 01 October 2009 20:46 To: Jerome Botbol Cc: php-general@lists.php.net Subject: Re: PHP/MySQL Superstars Hello, on 10/01/2009 10:09 AM Jerome Botbol said the following: Hi All, We require a PHP / MySQL superstar to work in-house at our offices near Edgware, London for 3 months on a ground breaking new web 2.0 project which involves a variety of exciting new technologies. You will need at least 2 years proven experience on commercial projects. Relevant experience on the CI framework is a must. You will be working with an actionscript and front-end XHTML developer, a framework developer who is providing a database design and class system and a design team. Please email your CV to j...@cyber-duck.co.uk (reference PG-tech-01) or feel free to contact me directly. Please let me know if this is of interest to you. You may want to submit your job post in the PHPClasses job board. There are many thousands of PHP developers registered to get notifications about jobs that match their skills. http://www.phpclasses.org/jobs/ If you prefer to tune your search by country and skill, you may want to browse the PHP professionals directory and check the skills in the search form as you wish: http://www.phpclasses.org/professionals/ -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL Superstars
Hello, on 10/01/2009 10:09 AM Jerome Botbol said the following: Hi All, We require a PHP / MySQL superstar to work in-house at our offices near Edgware, London for 3 months on a ground breaking new web 2.0 project which involves a variety of exciting new technologies. You will need at least 2 years proven experience on commercial projects. Relevant experience on the CI framework is a must. You will be working with an actionscript and front-end XHTML developer, a framework developer who is providing a database design and class system and a design team. Please email your CV to j...@cyber-duck.co.uk (reference PG-tech-01) or feel free to contact me directly. Please let me know if this is of interest to you. You may want to submit your job post in the PHPClasses job board. There are many thousands of PHP developers registered to get notifications about jobs that match their skills. http://www.phpclasses.org/jobs/ If you prefer to tune your search by country and skill, you may want to browse the PHP professionals directory and check the skills in the search form as you wish: http://www.phpclasses.org/professionals/ -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql Query Question.
ad...@buskirkgraphics.com wrote: Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shellmysql -uyourmom -plovesme --html This now will return all results in an html format from all queries. Now I could “tee” this to a file and save the results returned if I so choose to save the result of the display . Let’s say I want to be lazy and write a php MySQL query to do the same so that any result I queried for would return the html results in a table without actually writing the table tags in the results. Is there a mysql_connect or select_db or mysql_query tag option to do that since mysql can display it from the shell? I think you'll find that the HTML output is a function of the mysql command line program (I tend to use PostgreSQL, where 'psql' is a similar program) so you can only access that functionality by calling the command line. I suspect that, since PHP is a HTML processing language (originally), the creators of the mysql_ functions figured that the user could sort out making HTML from the data returned... It's should be a simple operation to write a wrapper function to put HTML around the results. There might even be a PEAR extension or PHPClasses class to do it (I haven't looked yet) -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/mySQL question using ORDER BY with logic
Rob Gould schrieb: Question about mySQL and PHP, when using the mySQL ORDER BY method... Basically I've got data coming from the database where a wine producer-name is a word like: Château Bahans Haut-Brion or La Chapelle de La Mission Haut-Brion or Le Clarence de Haut-Brion but I need to ORDER BY using a varient of the string: 1) If it begins with Château, don't include Chateau in the string to order by. 2) If it begins with La, don't order by La, unless the first word is Chateau, and then go ahead and order by La. Example sort: Notice how the producer as-in comes before the parenthesis, but the ORDER BY actually occurs after a re-ordering of the producer-string, using the above rules. Red: Château Bahans Haut-Brion (Bahans Haut-Brion, Château ) Red: La Chapelle de La Mission Haut-Brion (Chapelle de La Mission Haut-Brion, La ) Red: Le Clarence de Haut-Brion (Clarence de Haut-Brion, Le ) Red: Château Haut-Brion (Haut-Brion, Château ) Red: Château La Mission Haut-Brion (La Mission Haut-Brion, Château ) Red: Domaine de La Passion Haut Brion (La Passion Haut Brion, Domaine de ) Red: Château La Tour Haut-Brion (La Tour Haut-Brion, Château ) Red: Château Larrivet-Haut-Brion (Larrivet-Haut-Brion, Château ) Red: Château Les Carmes Haut-Brion (Les Carmes Haut-Brion, Château ) That logic between mySQL and PHP, I'm just not sure how to accomplish? I think it might involve a mySQL alias-technique but I could be wrong. Right now, my PHP call to generate the search is this: $query = 'SELECT * FROM wine WHERE MATCH(producer, varietal, appellation, designation, region, vineyard, subregion, country, vintage) AGAINST ( ' . $searchstring . ') ORDER BY producer LIMIT 0,100'; Hi, Try to solve your Logic on your programming language and to select Data with your Database... Try to normalize more your Information on the Database. Regars Carlos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/mySQL question using ORDER BY with logic
Robert Cummings wrote: On Fri, 2008-10-24 at 00:18 -0400, Rob Gould wrote: Question about mySQL and PHP, when using the mySQL ORDER BY method... Basically I've got data coming from the database where a wine producer-name is a word like: Château Bahans Haut-Brion or La Chapelle de La Mission Haut-Brion or Le Clarence de Haut-Brion but I need to ORDER BY using a varient of the string: 1) If it begins with Château, don't include Chateau in the string to order by. 2) If it begins with La, don't order by La, unless the first word is Chateau, and then go ahead and order by La. Example sort: Notice how the producer as-in comes before the parenthesis, but the ORDER BY actually occurs after a re-ordering of the producer-string, using the above rules. Red: Château Bahans Haut-Brion (Bahans Haut-Brion, Château ) Red: La Chapelle de La Mission Haut-Brion (Chapelle de La Mission Haut-Brion, La ) Red: Le Clarence de Haut-Brion (Clarence de Haut-Brion, Le ) Red: Château Haut-Brion (Haut-Brion, Château ) Red: Château La Mission Haut-Brion (La Mission Haut-Brion, Château ) Red: Domaine de La Passion Haut Brion (La Passion Haut Brion, Domaine de ) Red: Château La Tour Haut-Brion (La Tour Haut-Brion, Château ) Red: Château Larrivet-Haut-Brion (Larrivet-Haut-Brion, Château ) Red: Château Les Carmes Haut-Brion (Les Carmes Haut-Brion, Château ) That logic between mySQL and PHP, I'm just not sure how to accomplish? I think it might involve a mySQL alias-technique but I could be wrong. Right now, my PHP call to generate the search is this: $query = 'SELECT * FROM wine WHERE MATCH(producer, varietal, appellation, designation, region, vineyard, subregion, country, vintage) AGAINST ( ' . $searchstring . ') ORDER BY producer LIMIT 0,100'; Maybe there's a good way to do it with the table as is... but I'm doubtful. I would create a second field that contains a pre-processed version of the name that performs stripping to achieve what you want. This could be done by a PHP script when the data is inserted into the database, or if not possible like that, then a cron job could run once in a while, check for entries with this field empty and generate it. Yeah I'd suspect that the storage overhead is nothing compared to the speed increase you'll get during the read operations if you don't have to dick around with the data :) (yes I'm comparing bits to time, but I don't have time to explain that bit). Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP-MYSQL Error: Can't connect to MySQL socket. Can someone helpme out please?
By the way it installed MySQL 6 and PHP 5.0.4 and from the console this command does not work: mysql -u root -p but only this works: mysql -h hostname -u root -p I tried doing the same while connecting to the database via php but it does not work. Rahul wrote: I am using Fedora Core 4. As I was unable to use PHP or MySQL together, I uninstalled both of them and installed again using the following commands: yum install mysql And then apt-get install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick And then started the mysql server. I am able to connect to the server from the console my typing mysql -h hostname -u root -p mypass However, when I try to connect to mysql through PHP I get the following errors: PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /export/home/rahul/may/sample.php on line 5 PHP Warning: mysql_query(): A link to the server could not be established in /export/home/rahul/may/sample.php on line 5 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Can someone please help me out? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL CMS for Articles/Studies/Research Papers?
Jason Paschal wrote: just wanted to know if any of you have seen anything geared for this sort of content, something professional-looking that doesn't come with a huge learning curve. it wouldn't have to be TOO fancy, i could probably make something, but didn't want to re-invent the round-thing-that-rolls. I've not played with it but I saw mention of moodle.org on this list the other day and went to it to see what it was. Turns out to be a CMS targeted at learning programs. It's not exactly what you want but it may be the closest match Other people on this list may have other suggestions. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql - getting ID of query
John Pillion wrote: This is as much a mysql question as it is php. What is the most reliable way to retrieve an auto_increment key/id for a query you just inserted? In other words, I compile all my data, insert it into a new row, and now I want to retrieve the ID it created for it in the ID/key field. Without turning around and searching for the values I just inserted, is there a way to get the ID? The ID is the only field that is guaranteed to be unique in each data set, which makes it questionable to search for the data you just inserted, unless you searched for the *whole* data set. Thanks John mysql_insert_id() mysqli::insert_id PDO::lastInsertId() depending on the way you access it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: php/mysql - getting ID of query
Thanks guys, that's exactly what I was looking for J -Original Message- From: M. Sokolewicz [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 21, 2007 4:51 PM To: John Pillion Cc: php-general@lists.php.net Subject: Re: php/mysql - getting ID of query John Pillion wrote: This is as much a mysql question as it is php. What is the most reliable way to retrieve an auto_increment key/id for a query you just inserted? In other words, I compile all my data, insert it into a new row, and now I want to retrieve the ID it created for it in the ID/key field. Without turning around and searching for the values I just inserted, is there a way to get the ID? The ID is the only field that is guaranteed to be unique in each data set, which makes it questionable to search for the data you just inserted, unless you searched for the *whole* data set. Thanks John mysql_insert_id() mysqli::insert_id PDO::lastInsertId() depending on the way you access it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php-mysql problem
$sql = SELECT count(Email) as numEmails, Email FROM mena_guests WHERE Voted='yes' GROUP BY Email ORDER BY numEmails DESC LIMIT $startingID, $items_numbers_list; -- itoctopus - http://www.itoctopus.com Me2resh Lists [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi i need help regarding a sql query in my php app. the query is : $SQL = SELECT DISTINCT(EMail) FROM mena_guests WHERE Voted = 'yes' LIMIT $startingID,$items_numbers_list; i want to sort this query by the number of the repeated EMail counts. can anyone help me with that please ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php-mysql problem
$sql = SELECT count(Email) as numEmails, Email FROM mena_guests WHERE Voted='yes' GROUP BY Email ORDER BY numEmails DESC LIMIT $startingID, $items_numbers_list; I answered this morning, I don't know why it got deleted -- itoctopus - http://www.itoctopus.com Me2resh Lists [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi i need help regarding a sql query in my php app. the query is : $SQL = SELECT DISTINCT(EMail) FROM mena_guests WHERE Voted = 'yes' LIMIT $startingID,$items_numbers_list; i want to sort this query by the number of the repeated EMail counts. can anyone help me with that please ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP+MySQL website cache ? Yes/No
Martin Zvarík wrote: I did a benchmark with and without caching to HTML file and it's like: 0.0031 sec (with) and 0.0160 sec (with database) I know these miliseconds don't matter, but it will have significant contribution in high-traffic website, won't it? I would say yes. A good caching system is essential in a high traffic system. Ideally you'd allow very fine control over what blocks are cached and for how long with automated system for extending the life of the cache if the hosting environment is being hit hard. e.g. autodetect high load and make the cache last for 1h rather than 5 mins. I think you are on the right tracks to design this in. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mysql problem
On Tue, May 2, 2006 7:05 am, Ross wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. Change item_id 3 to 1. ... select id from board_papers where item_id = 3 ... $id3 = mysql_result($result); ... select id from board_papers where item_id = 1 ... $id1 = mysql_result($result); ... update board_papers set item_id = 1 where id = $id3 ... update board_papers set item_id = 3 where id = $id1 Delete an item: $item_id = 42; ... delete from board_papers where item_id = 42 ... update board_papers set item_id = item_id - 1 where item_id 42 It's up to you to actually add all the function calls and quotes and error-checking and make it work for variables instead of constants. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mysql problem
On Tue, May 2, 2006 7:22 am, chris smith wrote: On 5/2/06, Ross [EMAIL PROTECTED] wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. Why do you want to do that? There's no benefit in doing this.. actually it becomes a pain. You'd need to update not only this table but any field in other tables that references this one as well (and if you miss one, you have a completely useless database). No, we've got past that bit. Now he just wants user-definable ordering in sequence from 1 to N, using item_id as the user-modifiable field, and id as the auto_increment field. item_id is a HORRIBLE name for such a field, mind you... Call it rank or something, okay Ross? While you are at it, id is an awfully generic name for a field, really. I personally prefer: create table foo (foo_id int(11) auto_increment, ...); But, hey, a lot of folks go with just id on everything, and seem okay with that. [shrug] -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mysql problem
On 5/3/06, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, May 2, 2006 7:22 am, chris smith wrote: On 5/2/06, Ross [EMAIL PROTECTED] wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. Why do you want to do that? There's no benefit in doing this.. actually it becomes a pain. You'd need to update not only this table but any field in other tables that references this one as well (and if you miss one, you have a completely useless database). No, we've got past that bit. I posted that answer yesterday... By the time I got back to the thread everyone had worked out that he wanted to use it for ordering results ;) While you are at it, id is an awfully generic name for a field, really. I personally prefer: create table foo (foo_id int(11) auto_increment, ...); But, hey, a lot of folks go with just id on everything, and seem okay with that. [shrug] Very true - would get rather confusing in link tables: create table news_cat (id int, id int); heh. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php mysql problem
Ross schrieb: Just say I have a db CREATE TABLE `mytable` ( `id` int(4) NOT NULL auto_increment, `fileName` varchar(50) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; when I add items they go id 1,2,3 etc. Whn I delete them gaps appear. 1, 3, 7. I need to know (a) when items are removed how can I sort the database to all the gaps are take out 1, 3, 7 becomes 1,2,3 Why do you auto_increment them then? Normally it's very wrong to set back autoincremented values because you don't have any reference anymore. So if ID X is causing an error it could be Article X or Article Y or article Z. You don't know because the database is shifting it around. Add a second field called sort or something similiar and let it sort on that. Or give it Article Numbers or whatever. (b) allow the ids to be changed so the items can change position in the list. If I change id 3 to id 1 then everything else shifts down. update id = id +1 WHERE id X Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php mysql problem
This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. CREATE TABLE `board_papers` ( `id` int(4) NOT NULL auto_increment, `doc_date` varchar(10) NOT NULL default '-00-00', `article_type` enum('agenda','minutes','paper') NOT NULL default 'agenda', `fileName` varchar(50) NOT NULL default '', `fileSize` int(4) NOT NULL default '0', `fileType` varchar(50) NOT NULL default '', `content` blob NOT NULL, `item_id` int(10) default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; Ross [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Just say I have a db CREATE TABLE `mytable` ( `id` int(4) NOT NULL auto_increment, `fileName` varchar(50) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; when I add items they go id 1,2,3 etc. Whn I delete them gaps appear. 1, 3, 7. I need to know (a) when items are removed how can I sort the database to all the gaps are take out 1, 3, 7 becomes 1,2,3 (b) allow the ids to be changed so the items can change position in the list. If I change id 3 to id 1 then everything else shifts down. If anyone has seen the amazon dvd rental list where you can swap dvd to the top of the list and delete this is what I am trying to achive with php/mysql. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mysql problem
On 5/2/06, Ross [EMAIL PROTECTED] wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. Why do you want to do that? There's no benefit in doing this.. actually it becomes a pain. You'd need to update not only this table but any field in other tables that references this one as well (and if you miss one, you have a completely useless database). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mysql problem
This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. CREATE TABLE `board_papers` ( `id` int(4) NOT NULL auto_increment, `doc_date` varchar(10) NOT NULL default '-00-00', `article_type` enum('agenda','minutes','paper') NOT NULL default 'agenda', `fileName` varchar(50) NOT NULL default '', `fileSize` int(4) NOT NULL default '0', `fileType` varchar(50) NOT NULL default '', `content` blob NOT NULL, `item_id` int(10) default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; Ross [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Just say I have a db CREATE TABLE `mytable` ( `id` int(4) NOT NULL auto_increment, `fileName` varchar(50) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; when I add items they go id 1,2,3 etc. Whn I delete them gaps appear. 1, 3, 7. I need to know (a) when items are removed how can I sort the database to all the gaps are take out 1, 3, 7 becomes 1,2,3 (b) allow the ids to be changed so the items can change position in the list. If I change id 3 to id 1 then everything else shifts down. If anyone has seen the amazon dvd rental list where you can swap dvd to the top of the list and delete this is what I am trying to achive with php/mysql. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Really can't imagine why you wanna do something like this. What's the use in reordering a database. It's just a database. you can sort it in any way you like.. gaps or not.. Sounds to me the sorting is only done on screen. This is pretty easy done with PHP not in the database itself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mysql problem
Exactly - I don't think you really understand how a relational database works. The ids are retained as they may relate to records in another table. Internal sorting order is of no relevance at the application level. I think you need to rethink your design a little. On 02/05/06, T.Lensselink [EMAIL PROTECTED] wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. CREATE TABLE `board_papers` ( `id` int(4) NOT NULL auto_increment, `doc_date` varchar(10) NOT NULL default '-00-00', `article_type` enum('agenda','minutes','paper') NOT NULL default 'agenda', `fileName` varchar(50) NOT NULL default '', `fileSize` int(4) NOT NULL default '0', `fileType` varchar(50) NOT NULL default '', `content` blob NOT NULL, `item_id` int(10) default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; Ross [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Just say I have a db CREATE TABLE `mytable` ( `id` int(4) NOT NULL auto_increment, `fileName` varchar(50) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; when I add items they go id 1,2,3 etc. Whn I delete them gaps appear. 1, 3, 7. I need to know (a) when items are removed how can I sort the database to all the gaps are take out 1, 3, 7 becomes 1,2,3 (b) allow the ids to be changed so the items can change position in the list. If I change id 3 to id 1 then everything else shifts down. If anyone has seen the amazon dvd rental list where you can swap dvd to the top of the list and delete this is what I am trying to achive with php/mysql. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Really can't imagine why you wanna do something like this. What's the use in reordering a database. It's just a database. you can sort it in any way you like.. gaps or not.. Sounds to me the sorting is only done on screen. This is pretty easy done with PHP not in the database itself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://www.web-buddha.co.uk dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css) look out for project karma, our new venture, coming soon!
[PHP] Re: php / mysql / js search result question
Am 2005-12-27 08:03:42, schrieb Dave Carrera: Hi List, User input is a so the list moves to first instance of a. User continues to input ap so the list moves to 2 Apple Customer and so on. This can only be done from a JavaScript. Thank you in advance Dave c Greetings Michelle -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL
Here's one thought . ascii (97) is the letter a is it possible that the ascii (65) A was interpreted as lowercase thus creating a duplicate primary key? Or your DBMS doesn't make a distinction between upper or lower case. You are correct. I compiled mysql and php from source tar-ball. I dind' tknow that the default character set and collate are case-insensitive. It's fixed after I set the character set to latin1 and collate to latin1_bin in /etc/my.cnf. -- .~.Might, Courage, Vision. SINCERITY. http://www.linux-sxs.org / v \ /( _ )\ (Fedora Core 4) Linux 2.6.14-1.1653_FC4 ^ ^10:03:01 up 16 days 1:00 load average: 0.00 0.00 0.00 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL
Man-wai Chang wrote: A table with a column big5 char(2) not null primary key. $target-query(delete from canton); for ($ii=0; $ii256; $ii++) { for ($jj=0; $jj256; $jj++) { echo $ii ... $jj . \n; $query=insert into canton ( big5 ) values ( ' . mysql_real_escape_string(chr($ii).chr($jj)) . ' ); $target-query($query); } } The program died with this output: 0.92 0.93 0.94 0.95 0.96 0.97 Duplicate entry '' for key 1 The character strings shouldn't be repeated. Why did it stop at (0,97)? Here's one thought . ascii (97) is the letter a is it possible that the ascii (65) A was interpreted as lowercase thus creating a duplicate primary key? Or your DBMS doesn't make a distinction between upper or lower case. -- Jerry Kita http://www.salkehatchiehuntersville.com email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySql noob falls at first hurdle
On 12/9/05, Paul Jinks [EMAIL PROTECTED] wrote: Hi all I've been asked to put simple database interactivity on an academic site. They want users to enter a few details of their projects so other researchers can search and compare funding etc. How difficult can that be, I thought I've built the database in MySQL and entered some dummy data, and I'm now trying in the first place to get the data to display with a simple select query to display the variable projTitle from the table project thus: head snip ? $SQLquery = SELECT projTitle FROM project; $result = mysql_query($SQLquery) or die (couldn't execute query); mysql_close($connect) ? body pResult of b?=$SQLquery ?/b/p p ? while($ouput_row = mysql_fetch_array($result)) { ? ?=$output_row[projTitle]?br / ? } ? /p /body Try to check the key of your result row with a print_r or a var_dump command. Brice Favre http://pelmel.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySql noob falls at first hurdle
Are short tags disabled? Change this line... ?=$output_row[projTitle]?br / To... ?php echo ( $output_row[projTitle] ) ?br / This line seems to work : pResult of b?=$SQLquery ?/b/p -- Brice Favre http://pelmel.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP/MySql noob falls at first hurdle
Brice wrote: Try to check the key of your result row with a print_r or a var_dump command. Brice Favre http://pelmel.org/ Like this? ?php while($ouput_row = mysql_fetch_array($result)) print_r($output_row); ? Apologies if this is pathetically wrong. Like I said, I'm a total noob. The above returned no data or errors, by the way. Thanks Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP/MySql noob falls at first hurdle
[snip] Hi Paul, Why you are closing your connection before finishing your work on the database? Zareef Ahmed [/snip] I think Zareef has spotted the most important problem here Try removing the mysql_close() and trying it Dan -Original Message- From: Paul Jinks [mailto:[EMAIL PROTECTED] Sent: 09 December 2005 15:05 To: php-general@lists.php.net Subject: Re: [PHP] Re: PHP/MySql noob falls at first hurdle Brice wrote: Try to check the key of your result row with a print_r or a var_dump command. Brice Favre http://pelmel.org/ Like this? ?php while($ouput_row = mysql_fetch_array($result)) print_r($output_row); ? Apologies if this is pathetically wrong. Like I said, I'm a total noob. The above returned no data or errors, by the way. Thanks Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1316 (20051208) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySql noob falls at first hurdle
On 12/9/05, Paul Jinks [EMAIL PROTECTED] wrote: Brice wrote: Try to check the key of your result row with a print_r or a var_dump command. Brice Favre http://pelmel.org/ Like this? ?php while($ouput_row = mysql_fetch_array($result)) print_r($output_row); ? Exactly but you had a difference between the variable you instanciate and the one you print. If you can, try to modify the error reporting level on you php.ini. It can help for problem like this. -- Brice. http://pelmel.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MYSQL Dynamic Select Boxes: Please Help
Try asking in a newsgroup or forum specific to javascript, that has nothing to do with PHP Adele Botes wrote: I have 2 tables: products table product_id (INT 11 AUTOINCRE PRI) product_name (VARCHAR 255) product_desc (VARCHAR 255) color table color_id (INT 11 AUTOINCRE PRI) color (VARCHAR 255) image (VARCHAR 255) product_id (INT 11) I would like to create the first select box (pulling the options from the products table). Then I would like the second select box to display the color option related to the product_id in the first select box, thus changing the options dynamically. I've tried the following and it doesn't seem to work. What am I doing wrong? Please help: ?php include_once(../../config.inc.php); $DB_NAME = $DB_NAME[0]; if($DB_NAME[0]){ global $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME; mysql_connect($DB_HOST, $DB_USER, $DB_PASS); mysql_select_db($DB_NAME) OR die(MYSQL Error: error selecting DB); } // this works ? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; lang=en xml:lang=en head titleCempave :: Quality cement products/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 link rel=stylesheet type=text/css href=?php print WEB_ROOT;?html/style.css script type=text/javascript src=unobtrusivedynamicselect_ex2to4.js/script script type=text/javascript window.onload = function() { dynamicSelect(pda-brand, pda-type); } /script /head body topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0 form action=# select id=product_name name=product_name option value=select selectedSelect a product.../option ?php $sql1 = mysql_query(SELECT * FROM `products`); while ($row = @mysql_fetch_array($sql1)) { $product_id = $row['product_id']; $product_name = $row['product_name']; print option value='$product_name'$product_name/option; } ? /select !--table-- select id=color name=color option class=select value=select selectedSelect a color.../option ?php $sql1 = mysql_query(SELECT * FROM `products` LEFT JOIN `color` ON products.product_id = color.product_id WHERE color.product_id = '$product_id'); while ($row = @mysql_fetch_array($sql1)) { $product_id = $row['product_id']; $color_id = $row['color_id']; $color = $row['color']; //print trtd$product_id $color_id $color/td/tr; print option class='$product_id' value='$color'$color/option; } ? /select !--/table-- /form /body /html This is all the JavaScript code i used: function dynamicSelect(id1, id2) { // Feature test to see if there is enough W3C DOM support if (document.getElementById document.getElementsByTagName) { // Obtain references to both select boxes var sel1 = document.getElementById(id1); var sel2 = document.getElementById(id2); // Clone the dynamic select box var clone = sel2.cloneNode(true); // Obtain references to all cloned options var clonedOptions = clone.getElementsByTagName(option); // Onload init: call a generic function to display the related options in the dynamic select box refreshDynamicSelectOptions(sel1, sel2, clonedOptions); // Onchange of the main select box: call a generic function to display the related options in the dynamic select box sel1.onchange = function() { refreshDynamicSelectOptions(sel1, sel2, clonedOptions); }; } } function refreshDynamicSelectOptions(sel1, sel2, clonedOptions) { // Delete all options of the dynamic select box while (sel2.options.length) { sel2.remove(0); } // Create regular expression objects for select and the value of the selected option of the main select box as class names var pattern1 = /( |^)(select)( |$)/; var pattern2 = new RegExp(( |^)( + sel1.options[sel1.selectedIndex].value + )( |$)); // Iterate through all cloned options for (var i = 0; i clonedOptions.length; i++) { // If the classname of a cloned option either equals select or equals the value of the selected option of the main select box if (clonedOptions[i].className.match(pattern1) || clonedOptions[i].className.match(pattern2)) { // Clone the option from the hidden option pool and append it to the dynamic select box sel2.appendChild(clonedOptions[i].cloneNode(true)); } } } // Attach our behavior onload window.onload = function() { dynamicSelect(product_name, color); } Thx in adv Adele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP/MySQL offline
... an automated script that creates a static site that will allow me to do that? If all you're really looking for is a static version of your site then you could simply use wget. This will crawl all of the links on your site and generate the static version you wanted. On Sep 5, 2005, at 11:11 PM, viraj wrote: On 9/4/05, John Taylor-Johnston [EMAIL PROTECTED] wrote: This is maybe what you want: http://www.indigostar.com/ http://www.indigostar.com/microweb.htm another good method is a Live Linux CD. you can find a light weight live linux distro and remaster it to include your live web site. so your client can put boot his/her pc with this cd and start browsing the site. this way you can use whatever the LAMP combination! http://www.google.com/search?hl=enq=howto+remasterspell=1 http://taprobane.org/ ~viraj. Runs an apache server, php all, from a CD. (windows app.) John Mario netMines wrote: Hi all I have a project where I'm using PHP/Mysql. The client wants to run that project to a cd. Does anyone know of a trick either by using javascript, XML or an automated script that creates a static site that will allow me to do that? Many Thanks M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP/MySQL offline
On 9/4/05, John Taylor-Johnston [EMAIL PROTECTED] wrote: This is maybe what you want: http://www.indigostar.com/ http://www.indigostar.com/microweb.htm another good method is a Live Linux CD. you can find a light weight live linux distro and remaster it to include your live web site. so your client can put boot his/her pc with this cd and start browsing the site. this way you can use whatever the LAMP combination! http://www.google.com/search?hl=enq=howto+remasterspell=1 http://taprobane.org/ ~viraj. Runs an apache server, php all, from a CD. (windows app.) John Mario netMines wrote: Hi all I have a project where I'm using PHP/Mysql. The client wants to run that project to a cd. Does anyone know of a trick either by using javascript, XML or an automated script that creates a static site that will allow me to do that? Many Thanks M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL offline
This is maybe what you want: http://www.indigostar.com/ http://www.indigostar.com/microweb.htm Runs an apache server, php all, from a CD. (windows app.) John Mario netMines wrote: Hi all I have a project where I'm using PHP/Mysql. The client wants to run that project to a cd. Does anyone know of a trick either by using javascript, XML or an automated script that creates a static site that will allow me to do that? Many Thanks M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL insert
On 8/19/05, Richard Lynch [EMAIL PROTECTED] wrote: On Fri, August 19, 2005 12:56 pm, areguera wrote: could you suggest something about Latin characters and portability?. As I understand it, or not, more likely, you want to configure your MySQL server to use UTF-8, and your MySQL client to use UTF-8 and pretty much everything to use UTF-8, and then you can convert your data to UTF-8 and its gonna store it in a way that you'll be able to convert back to Latin-1 or whatever you like. At least, that's what Mark Matthews of MySQL A/B said in his talk about this at our more recent Chicago MySQL User Group meeting. You may want to take this question to the i18n PHP list, where people who have actually done it hang out. :-) thanks Richard, I'll make a walk around i18n php list...:) ... it seems that utf-8 is the solution for internationalization, but I ask my self what would happen with prior versions of mysql without utf-8 support? and how to design an application to both run as utf-8 or iso-8859-1 in the require situation. can it be? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL insert
Please always reply to the list so that others can benefit from the exchange. As it happens, I'm not exactly very knowledgeable about character sets, so someone on the list may be able to offer more help with regard to the problem you're experiencing. -Ben areguera wrote: On 8/19/05, Ben Ramsey [EMAIL PROTECTED] wrote: Alain Reguera Delgado wrote: you could try: 1. get all form variables into an array fine 2. validate values Good, but do this step as you put the values into a separate array, don't put all the values into the array first and then validate them later... make sure the input received is input expected and then save only the input to the array that passes the validation/filtering tests yes .. that's much better .. :) 3. convert all values into entities using htmlentities() Why do you want to do this before saving to the database? Ben, I got some troubles when moving database from one server to another, all Latin characters disappear, and the info turns a mess. Thought for a moment a server's language configuration setting. I was wondering by days to take this way, I thought if someone else wants the application and occurs the same because his configuration is not like mine. Then that solution came to me. Felt no matter what version or configuration of mysql or other db is used or what latin char is inserted, the data always be there for the web, in the language it speaks. This step has absolutely no bearing on preparing the statement for insertion into a database. It won't protect against SQL injection. Also, you will never be able to do anything with this data other than use it for HTML output (unless you try to reverse the entities, which seems like an awful lot of work to me). yes, I don't like either...its not flexible. It's best to save the raw data as entered and escape it (with htmlentities() or something else) ONLY on output. that was the first way I used to go... but after that problem, I am not sure As I mentioned in my last post to this thread, the best way to escape a string for insertion into a database (and protect against SQL injection) is to use the escape function for the particular database -- mysql_real_escape_string() in this case. You should never use htmlentities() to escape data before saving it to a database. Do that only after you've pulled data from the database and are outputting it somewhere (like on a Web page). 4. build sql query (do some tests 'til get it right) 5. execute the built query (with proper db function) by now, commas aren't a problem, they are limited between sql query's quotes. If some quotes are inserted as value they are previously converted to its entities and do not break the sql query. This is why you use mysql_real_escape_string(), etc. -- not htmlentities(). as previously said in this thread, the problem is on quoting and maybe on converting the values to entities, to prevent some quote break the sql structure. You don't need to convert the values to HTML entities when saving to a database. That's not going to prevent this problem. could you suggest something about Latin characters and portability?. Thanks for your time Ben. I am new in the list and in php too. Thanks for your answers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL insert
sorry...here is the message On 8/19/05, areguera [EMAIL PROTECTED] wrote: On 8/19/05, Ben Ramsey [EMAIL PROTECTED] wrote: Alain Reguera Delgado wrote: you could try: 1. get all form variables into an array fine 2. validate values Good, but do this step as you put the values into a separate array, don't put all the values into the array first and then validate them later... make sure the input received is input expected and then save only the input to the array that passes the validation/filtering tests yes .. that's much better .. :) 3. convert all values into entities using htmlentities() Why do you want to do this before saving to the database? Ben, I got some troubles when moving database from one server to another, all Latin characters disappear, and the info turns a mess. Thought for a moment a server's language configuration setting. I was wondering by days to take this way, I thought if someone else wants the application and occurs the same because his configuration is not like mine. Then that solution came to me. Felt no matter what version or configuration of mysql or other db is used or what latin char is inserted, the data always be there for the web, in the language it speaks. This step has absolutely no bearing on preparing the statement for insertion into a database. It won't protect against SQL injection. Also, you will never be able to do anything with this data other than use it for HTML output (unless you try to reverse the entities, which seems like an awful lot of work to me). yes, I don't like either...its not flexible. It's best to save the raw data as entered and escape it (with htmlentities() or something else) ONLY on output. that was the first way I used to go... but after that problem, I am not sure As I mentioned in my last post to this thread, the best way to escape a string for insertion into a database (and protect against SQL injection) is to use the escape function for the particular database -- mysql_real_escape_string() in this case. You should never use htmlentities() to escape data before saving it to a database. Do that only after you've pulled data from the database and are outputting it somewhere (like on a Web page). 4. build sql query (do some tests 'til get it right) 5. execute the built query (with proper db function) by now, commas aren't a problem, they are limited between sql query's quotes. If some quotes are inserted as value they are previously converted to its entities and do not break the sql query. This is why you use mysql_real_escape_string(), etc. -- not htmlentities(). as previously said in this thread, the problem is on quoting and maybe on converting the values to entities, to prevent some quote break the sql structure. You don't need to convert the values to HTML entities when saving to a database. That's not going to prevent this problem. could you suggest something about Latin characters and portability?. -- Ben Ramsey http://benramsey.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL insert
On Fri, August 19, 2005 12:56 pm, areguera wrote: could you suggest something about Latin characters and portability?. As I understand it, or not, more likely, you want to configure your MySQL server to use UTF-8, and your MySQL client to use UTF-8 and pretty much everything to use UTF-8, and then you can convert your data to UTF-8 and its gonna store it in a way that you'll be able to convert back to Latin-1 or whatever you like. At least, that's what Mark Matthews of MySQL A/B said in his talk about this at our more recent Chicago MySQL User Group meeting. You may want to take this question to the i18n PHP list, where people who have actually done it hang out. :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL insert
Commas are no problem within strings. You might have an apostrophe, which SQL assumes is the end of the string literal. That was answered by Chris already, I just wanted to clarify the problem. You don't need to insert NULL in indx. If indx allows NULL and has no other default value nor is it autoincrement by not mentioning in the list of columns nor specifying a value, it will get a NULL. Satyam Jon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please help with an insert problem. Sometimes $data1 could have a comma and that messes up the insert. how do I get around that? $query = insert into testtable6 (indx, col1, col2) values (NULL, '$data1', '$data2'); mysql_db_query(testdb, $query); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL insert
Jon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please help with an insert problem. Sometimes $data1 could have a comma and that messes up the insert. how do I get around that? $query = insert into testtable6 (indx, col1, col2) values (NULL, '$data1', '$data2'); mysql_db_query(testdb, $query); You are looking for the addslashes function. It prepares data for database querys: $query = insert into testtable6 (indx, col1, col2); $query .= values (NULL, ' . addslashed($data1) . '; $query .= ,' . addslashed($data2) . '; mysql_db_query(testdb, $query); Also, you will need to use the removeslashes function when you get data from a query. DanB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL insert
Dan Baker wrote: You are looking for the addslashes function. It prepares data for database querys: Better yet, don't use addslashes(). Use the escaping function that is specific to the database you're using. In this case, it's mysql_real_escape_string(). This is much better than using addslashes() because it takes into account the current character set of the database connection. http://www.php.net/mysql_real_escape_string Also, you will need to use the removeslashes function when you get data from a query. If you properly store data to a database, you should never have to use the stripslashes() function. Using stripslashes() will remove slashes that were intended to be in the output. Hint: turn off magic_quotes_gpc. -- Ben Ramsey http://benramsey.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL insert
you could try: 1. get all form variables into an array 2. validate values 3. convert all values into entities using htmlentities() 4. build sql query (do some tests 'til get it right) 5. execute the built query (with proper db function) by now, commas aren't a problem, they are limited between sql query's quotes. If some quotes are inserted as value they are previously converted to its entities and do not break the sql query. as previously said in this thread, the problem is on quoting and maybe on converting the values to entities, to prevent some quote break the sql structure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL insert
Alain Reguera Delgado wrote: you could try: 1. get all form variables into an array fine 2. validate values Good, but do this step as you put the values into a separate array, don't put all the values into the array first and then validate them later... make sure the input received is input expected and then save only the input to the array that passes the validation/filtering tests 3. convert all values into entities using htmlentities() Why do you want to do this before saving to the database? This step has absolutely no bearing on preparing the statement for insertion into a database. It won't protect against SQL injection. Also, you will never be able to do anything with this data other than use it for HTML output (unless you try to reverse the entities, which seems like an awful lot of work to me). It's best to save the raw data as entered and escape it (with htmlentities() or something else) ONLY on output. As I mentioned in my last post to this thread, the best way to escape a string for insertion into a database (and protect against SQL injection) is to use the escape function for the particular database -- mysql_real_escape_string() in this case. You should never use htmlentities() to escape data before saving it to a database. Do that only after you've pulled data from the database and are outputting it somewhere (like on a Web page). 4. build sql query (do some tests 'til get it right) 5. execute the built query (with proper db function) by now, commas aren't a problem, they are limited between sql query's quotes. If some quotes are inserted as value they are previously converted to its entities and do not break the sql query. This is why you use mysql_real_escape_string(), etc. -- not htmlentities(). as previously said in this thread, the problem is on quoting and maybe on converting the values to entities, to prevent some quote break the sql structure. You don't need to convert the values to HTML entities when saving to a database. That's not going to prevent this problem. -- Ben Ramsey http://benramsey.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL insert
Ben Ramsey wrote: You don't need to convert the values to HTML entities when saving to a database. That's not going to prevent this problem. Furthermore, you don't need to use htmlentities() if you specify your character set properly and all the characters you are outputting are in your character set. For example, I use UTF-8 for all output, and all the characters I ever use are (of course) in the UTF-8 character set. Therefore I only need to use htmlspecialchars() to turn characters that have special meaning in HTML (, ', , , , etc.) into entities. Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php mySql question
Sure that your php.ini is located correctly? I have installed php 5.0.4 on my windows 2000, IIS 6.0 server. PHP works but when I try to connect to MySQL I get the Fatal error: Call to undefined function mysql_connect(). I have uncommented the line in the php.ini file that says 'extension=php_mysql.dll'. I have path variables set for both c:\php and c:\php\ext. One very peculiar thing that I noticed when I ran phpinfo() is that it shows the extension_dir is set to c:\php5 even though in my php.ini file it is set to c:\php. I have a feeling that this is where the problem exists. Any advice would be appreciated. Thanks, NK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php + mysql: binary arrays
Hope I was helpful Yaron Khazai Thanks - will try that out soon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql url validation methods...
Darren Kirby wrote: Hello all, On the main page of my website I have written a very simple comments feature that allows people to leave a message under my posts, much like a blog. I have purposely kept this very simple... On the main page I have simple text links that someone can click on if they want to leave a note. Clicking the link passes a variable $postid (a simple int) to the backend script, which tells the database which 'blog entry' the comment is attached to. The problem is that after playing around with this a bit, it is clear that someone can craft a url with an arbitrary $postid that is not in the database yet. Now naively, it would seem that the worst someone could do is just create arbitrary entries in the DB that may come back to bite me when I actually _use_ the arbitrary postid down the road. Well a couple of things that I can think of here... - Doing this seems like an easy way to get orphaned posts i.e. blogs that are stored in the database, but because there is no thread that corresponds to this blog then it would be a waste of DB storage - Might allow a malicious user to change an already-created post. They might even be able to stick in some PHP / Javascript code that could compromise the security of anyone that happens to read that blog! What I want to do is make sure that someone cannot create a post with a $postid value greater than the largest $postid I have used so far. And you want to be sure that they cannot create a post with a $postid that has already been used. Now, I thought about using a quick sql query to get the largest postid from the DB and check that, but this will not work because of my own bad DB design How about... instead of generating *any* $postid in your form, you just let MySQL handle it when it's ready to insert a new message. Just have the ID be an auto-increment in the DB... and this ID never needs to go to the browser (unless you're allowing a user to edit their *own* post). In the case of an edit you then check that the username in MySQL matches the username attached to the $_SESSION (or just don't let people edit ;) (I'm really just a hobbyist here...) in that if there are no comments attached to a blog entry, then the postid for that entry is _not_ in the DB until I get one. So, I guess my option is to either create another DB table with only the valid postid's in it and check that, or perhaps use a regexp to grab the highest postid from the html link (which would be the one closest to the top of the page). I really don't want to have to change the current DB table, or have to update one manually when I ad a new post on the main page. I guess my question is if there is an easier way to validate the postid value passed in the url. How would you do it? Again... unless I'm missing something here the only thing you might want to send into a form / validate on the server would be a thread ID to figure out which thread this post belongs to. If you need more info, please just ask... Thanks, Darren Kirby -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM | http://www.php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins signature.asc Description: OpenPGP digital signature
Re: [PHP] Re: php/mysql url validation methods...
quoth the Jason Barnett: Darren Kirby wrote: The problem is that after playing around with this a bit, it is clear that someone can craft a url with an arbitrary $postid that is not in the database yet. Now naively, it would seem that the worst someone could do is just create arbitrary entries in the DB that may come back to bite me when I actually _use_ the arbitrary postid down the road. Well a couple of things that I can think of here... - Doing this seems like an easy way to get orphaned posts i.e. blogs that are stored in the database, but because there is no thread that corresponds to this blog then it would be a waste of DB storage - Might allow a malicious user to change an already-created post. They might even be able to stick in some PHP / Javascript code that could compromise the security of anyone that happens to read that blog! Well, I did make sure to scrub the input so that code tags are turned into character entities. Again, I am naive on such things but my understanding is that this will take care of '?php ?' or script 'tags' What I want to do is make sure that someone cannot create a post with a $postid value greater than the largest $postid I have used so far. And you want to be sure that they cannot create a post with a $postid that has already been used. How about... instead of generating *any* $postid in your form, you just let MySQL handle it when it's ready to insert a new message. Just have the ID be an auto-increment in the DB... and this ID never needs to go to the browser (unless you're allowing a user to edit their *own* post). In the case of an edit you then check that the username in MySQL matches the username attached to the $_SESSION (or just don't let people edit ;) Again... unless I'm missing something here the only thing you might want to send into a form / validate on the server would be a thread ID to figure out which thread this post belongs to. Well, the $postid variable _is_ the thread id. The thread id is not unique to each comment, only to each original blog entry (which I add manually to the static page). So $postid's purpose is only to tell php and the DB which blog entry the comment is attached to. Here's what my table looks like: | id | mediumint(10) (auto_increment) | name| varchar(30) binary | email | varchar(30) | url | varchar(30) | postid | mediumint(10) | message | text | date| varchar(30) So when I display the comments, for each blog entry I just use: mysql_query(SELECT * FROM comment_table WHERE postid='$postid' ORDER BY id); So the problem remains, there is nothing in the DB that would indicate the highest valid postid number, because until someone actually leaves a comment, the corresponding postid doesn't exist in the DB. Like I said, I'm sure I could have designed the table better, but I am just playing here really. What I have done in the interim is add: $num_entries = 11; if ($postid $num_entries) { print('sorry bud...nice try'); return; } But this is inelegant because I have to manually update the value of $num_entries everytime I add a new one. I should be able to live with this though, it does the trick all right. Thanks for all your help, Darren -- darren kirby :: Part of the problem since 1976 :: http://badcomputer.org ...the number of UNIX installations has grown to 10, with more expected... - Dennis Ritchie and Ken Thompson, June 1972 pgpy3xfjnYu4Y.pgp Description: PGP signature
[PHP] Re: php mysql codes insertion error.
Found the problem. I set ( default_charset = iso-8859-1 ) in php.ini and it solve the problem. Just in case anyone want to know. Jonathan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have encounter something rather weird. In my development server, when I insert a string contain '*%$, I got this in my mysql server '*%$ (i.e. the same) but in my application server, I got this â?T*%$ in my mysql server (i.e. ' == â?T) anyone know how to resolve this? When I use the string to send out the email, I got the funny characters instead. Version Running development server mysql-server-3.23.58-9 php-4.3.4 application server: mysql-server-3.23.58-9 php-4.3.8-2.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re. [PHP] mysql networking ?
Hi its a php mailing list ? Okey . -- Manoj Kr. Sheoran Aalee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi guys, I have a small home network working with just 4 computers (PC's on WinXP Pro) connected through a switch just using the local ip's 192.168.0.1 and so on. And the netwok is working fine. I have installed MySQL on one computer and setup a database and installed MySQL on the other PCs aswell. But am having problem getting into the server computer where the databases are setup. Does any one of you know of any good tutorials out there how to setup a small network using MySQL using windows XP. I have come across some tutes, but most of them are on using Linux. Or any advice would be helpful. Thanks on advance aalee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/MYSQL remove duplicate records
I do that a lot using Microsoft Access. I just finished on a project where I had to eliminate duplicates from each of three or more queries, a couple of which have three keys. However I am not much more experienced han you are; Microsoft Access generates SQL for us so I am not sure what the SQL looks like. This is actually a SQL question; I think it can be solved entirely by SQL. However I don't know and it is not my responsibility to decide such things. You can (should) sort by email address of course. Then there is a function for getting the count of a field. The result will be records with the email address occuring only once. The following I think is a simplified version of something I have done: SELECT ITEMNO, COMP1, COMP2, Count(COMP2) AS CountOfCOMP2 FROM CostsMerge GROUP BY ITEMNO, COMP1, COMP2; However I have another duplicates removal query that uses Last but not Count, as in: SELECT Item, Comp1, Comp2, Last(Comp1Q), Last(Comp2Q) INTO MergedData FROM Merge GROUP BY ITEMNO, COMP 1, COMP 2; In both of the above, there are three keys: Item, Comp1 and Comp2; whereas you have just one key, the email address. Dustin Krysak [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there - I have an extremely simple table that has a unique Id and an email address. what I am looking for is an example of a PHP script that will poll the MYSQL database and delete the duplicate records leaving only 1 unique (email) record. can someone point me to the right place? thanks! d -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL DATE comparison
Ryan Schefke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I'm pulling a date in the datetime format via a MySQL query. Using PHP I would like to check if that date is prior to today's date. Can someone please help with this quick question. You could convert it to a timestamp via strtotime() and check it against time(): $date = strtotime($dateFromDb); if ($date time()) { echo 'Date is in the past.'; } Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL difficulties on WindowsXP
I don't know if this is the root of your problem or not, but I tried running PHP 4.3.5 on my Win2K box and it crashed a lot. I found out that if you have PHP configured to run as a SAPI module there are stability issues with that version (this bug has been reported). I think the CGI install should be good though. I reverted back to version 4.3.4 and don't have any problems yet with the SAPI module. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello; We are having a miserable time with MySQL on a Windows/IIS server with PHP. Here's the version numbers: MySQL 3.23.58-nt PHP 4.35 Windows XP (although we previously experienced the same problems w/ Server 2000), 1gb RAM The site is for academics to submit scientific papers (data) for their organization. In addition to submitting data, they can browse and search the database. The problem is that one or more times per day, they whole thing grinds to a halt. Not sure that the server is completely locking up, but response times are so slow it might was well be. Restarting MySQL corrects the problem, but that may be a symptom rather than the disease. At one time we had IIS running on one server and MySQL on another. In this configuration, the IIS server would lock up, and reloading MySQL on *that* machine fixed the problem, according to my administrator. That server was remote, and the admin drove out to it to observe and noted that there were virtual RAM errors - running out - which motivated us to move it to the XP box in the office. There's really not much complicated going on here. The paper submission engine is session based, and some data is stuffed into session variables until it can be validated in later steps, then saved to the database. I've optimized the queries as much as possible, checked that MySQL connections are being closed and result resources freed, and php session variables unset and the session destroyed when appropriate. We're stuck, and the client is getting upset. Ideas? TIA Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql email
[EMAIL PROTECTED] (Bigmark) wrote in news:[EMAIL PROTECTED]: I have a sports tipping script and instead of using the admin to close a round off or input results ,would it be possible to do it via an email. Mark This can be done on a Unix style system by creating a mail alias which pipes the incoming mail to a php cli script. The details depend on the system setup, mail package etc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql run on Microsoft Personal Web Server 4.0 ?
Five [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've been learning php/mysql by uploading my scripts to a php/mysql enabled website. It's getting to be a drag uploading each script change to check if it works. I think this can be done but wanted to double check before starting instalation. Will Microsoft Personal Web Server 4.0 running on Win98se support php and mysql? advance thanks Dale I can tell you if you install the server, install php using the windows installer, and then try to run a php script, nothing happens : ( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: php/mysql run on Microsoft Personal Web Server 4.0 ?
[snip] I can tell you if you install the server, install php using the windows installer, and then try to run a php script, nothing happens [/snip] You cannot do it with the Personal Web Server. Might I recommend that you download Apache for Windows? Then you can use PHP all day long. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP || MySql Directory Tree Problem......
Hey all. I've developed a site builder application that allows my clients to build/maintain their sites without my having to deal with tedious web design tasks. The current version has some problems, however. To resolve these issues I've switched over to an MVC (Model-View-Controller) structured site. Great results so far except for one problem: the site directory structure. Currently I have all page ids titles stored in my site_tree table. The site_tree table has the following structure: prime_id (int auto_increment) parent_id (int) layout (int) secure (int) pop_menu (char 1) title (var char 200) Here's some example to data to clarify the purpose of this table: prime_id parent_id layout secure pop_menu title 2 0 2 0 Y Resources 3 0 1 0 Y Memberships 4 2 3 0 N Children and Youth 5 0 3 0 N Events 6 2 1 0 N Adult Education Rows 3 5; i.e. Children and Youth Adult Education, correspond to the parent category, Resources, whose prime_id is 2. So, each child category's parent_id is the prime_id of the parent category and each child can be a parent to many children. One use of this structure is to auto build the javascript popup menu for the site navigation (the pop_menu flag is used for this purpose). The problem I'm having is retrieving data from, for example, the products table: prime_id page_id copy product_type 1 4 Test 1 2 6 Test1 1 The products table page_id equals the prime_id of the site_tree table. When I query for product data based on the product category; i.e. Resources, which has a prime_id of 2, there is no matching record in the products table (since the products table only contains specific items, not category data). So, what can I do to join the site_tree table with the products table and other similarly structured tables? Please email for further details -- there's likely stuff I'm leaving out. TIA for ny clues re: site tree models. --Noah --
[PHP] Re: php/mysql run on Microsoft Personal Web Server 4.0 ?
Five [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've been learning php/mysql by uploading my scripts to a php/mysql enabled website. It's getting to be a drag uploading each script change to check if it works. I think this can be done but wanted to double check before starting instalation. Will Microsoft Personal Web Server 4.0 running on Win98se support php and mysql? advance thanks Dale If anyone is sstill interested, here's an excelent website that walks you through downloading, installing and configuring apache, php, and mysql. http://internetmaster.com/installtutorial/index.htm If it can work for my dyslexic eyes, it can work for anyone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/ MySQL Login Module
If you can use Dreamweaver, you must use one extension to make this. Is very simple. http://www.macromedia.com/cfusion/exchange/index.cfm - zerof - Pushpinder Singh [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] hello everyone. I am using PHP and MySQL on my website. Till now I was using a Login module with sessions, but the look and feel was not quite up to -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP, MySQL problem
Hi Add records with this code. ?php $name=isset($_POST['name']) ? $_POST['name'] :''; $address=isset($_POST['address']) ? $_POST['address'] :''; if (!empty($name)) { mysql_connect($server,$user,$pass) or die (Error conecting); mysql_select_db($dbnamn,$conection) or die (no db .$dbnamn); $query = insert into mytable (name, address) values ('$name', '$address'); $result = mysql_query ($query) or die(bad query); } ? html head/head body form action= method=post name input name=name address input name=address input type=submit value=add record /form /body/html Hope this helps. Jan Nicolai Elmqvist [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hi I have just started working with PHP and MySQL and have gone through 3 tutorials on how to add and delete records from a database. Nearly everything is working, as it should except for the communication between HTML form and PHP. If I try to add a record to my database by pushing a submit the text in the textboxes are deleted but no record is inserted in the database. I have copied the code directly form the tutorials so spelling mistakes should not be the problem. It is possible to add records manually in the code so the connection to and from the database is ok. So, does anybody know what I the problem might be? I'm using PHP 4.3.4, MySQL 4.0.17 and an Apache server. On before hand, thank you. Nicolai Elmqvist -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL with Microsoft Word
Use MySQLODBC... I use it to manage my databases through MS Access. I haven't integrated it yet with Word, but it is my intention in the near future. Hope this helps. Respectfully, Gary Satch wrote: Is there any way to have a web page (PHP) that draws data from a database (MySQL) then populates a Microsoft Word document? I have some Microsoft Word templates that are manually populated and cry out for database integration, but Microsoft Access is not robust enough. For an even harder question: is there a way to do the reverse? i.e. take the populated fields from the Word document and insert the values in the database? Thanks! Satch [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP/MySQL with Microsoft Word
for accessing the word document, assuming your server is a windows platform consider the following; http://www.php.net/manual/en/ref.com.php good luck, Warren Vail -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Gary C. New Sent: Tuesday, January 06, 2004 12:12 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP/MySQL with Microsoft Word Use MySQLODBC... I use it to manage my databases through MS Access. I haven't integrated it yet with Word, but it is my intention in the near future. Hope this helps. Respectfully, Gary Satch wrote: Is there any way to have a web page (PHP) that draws data from a database (MySQL) then populates a Microsoft Word document? I have some Microsoft Word templates that are manually populated and cry out for database integration, but Microsoft Access is not robust enough. For an even harder question: is there a way to do the reverse? i.e. take the populated fields from the Word document and insert the values in the database? Thanks! Satch [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql data display
Jlake [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a small database that I want to display data from. in such a way that it shows shows in a table with the table header being the department category and the table cells being the categories for each department. I have no problem connecting to the database) I imagine that I will need nested loops, but I haven't seen a tutorial showing quite what I am looking for. If anyone can point me in the right direction that would be great. Maybe this example would be of some help: http://www.templatetamer.org/index.php?MySqlRowList rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP, MySQL and datetime
Guess it matters on which one you want to do the date handling...php or MySQL. If it's PHP, I like epoch time, makes manipulating time and dates very simple (basic math). MySQL has its own timestamp format (the guy above me mentions it). Whichever you feel more comfortable with. John Jough Jeaux [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Greetings all, I'm working on a message-board-type application that will use time stamps to sort part of the messages. I was wondering what everyone's favorite way to transfer dates between PHP and MySQL was? --Jough - Do you Yahoo!? Free Pop-Up Blocker - Get it now -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL/Server not working
Hey, Also the webhost only allows us database direct database connection using phpMyadmin, I did notice that on the table that stores the info, it keep getting an error after someone is posting the form. The error says something about Overhead: 275 bytes, Is this just an MySQL limitation that is set by the webhost ? and this overhead you think that would keep the info from being entered into the database. To get the error to go away I have to optimize the table. ConbuD Conbud [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey, just a quick question, I have a form that users can fill out to join a certain group, we can then view that info from an admin page that requires logging in. When a user fills out the form I get an email letting me know that the form was submitted with the users info as well. Here recently, I've been getting that info but their info isn't being saved into the database for somereason, anyone have any idea why ? I have filled out the form at least 15-25 times using different info and everyone of them worked for me. I even filled out the form using different special characters and still with no problems, I am using stripslashes on the form data, but I don't think that could keep the info from being saved to the database, it only does this periodically. Could this be due to a slow server ? or is there some sort of special character that could conflict with my PHP or with the MySQL syntax ? I just have no clue now. Any thoughts are appreciated. Thanks ConbuD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php mysql array question
I use the PEAR db http://pear.php.net/manual/en/package.database.php This returns arrays - examples here http://pear.php.net/manual/en/package.database.db.intro-fetch.php look at the Quick data retreaval down the page pete Larry Brown wrote: Is there any php function to pull a query into an array? I know there is a way to get the first row of the results in an array, but I'm having to loop through each row pushing the row onto an array to get the result I'm looking for and it seems like a lot of code for something that I would think is used a lot. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php mysql array question
It shouldn't take a lot of code to put results into an array: $query = select * from table; $r = mysql_result($query); while ($row = mysql_fetch_object($r)) $hold[] = $row; (OR, to index by some id field in the database:) $hold[$row-id] = $row; mysql_free_result($r); Total of 5 lines. -- Rob Larry Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there any php function to pull a query into an array? I know there is a way to get the first row of the results in an array, but I'm having to loop through each row pushing the row onto an array to get the result I'm looking for and it seems like a lot of code for something that I would think is used a lot. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: PHP Mysql Error Code 1062 - Duplicates found
Hi All, I found out how to do it already. Thanks for the help. mysql_error() was the key.. Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Ow Mun Heng Sent: Wednesday, June 25, 2003 10:03 AM To: [EMAIL PROTECTED] Subject: PHP Mysql Error Code 1062 - Duplicates found Hi PHP'ers, I've got a question regarding the input of (multiple) data into mysql through PHP. If there is already an entry in the database, then an mysql will generate an error 1062 stating that the entry is a duplicate. (This will happen only if I input the data through mySQL using xterm, if I use PHP, then I only get the 'duplicate entry found', partly cause I don't know how to get the error code as well as the duplicate entry returned to PHP to be output'ed to the browser. Below is my code. $my_query is concatenated from an array. $my_query = $my_query. \n('.$SN[$i].','.$DCM[$i].','.$Supp[$i].','.$time_now.'),; $query = INSERT INTO pioneer(serial_no,dcm,supplier,fa_timestamp) VALUES $my_query;; $result = mysql_db_query('tracker',$query); if ($result) echo brbr.mysql_affected_rows(). Drives DCM combo inserted into database.; else echo \nbrbrDuplicate entry found. Data not inserted.; Can anyone help me out? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Mysql Hit Counter
http://www.hotscripts.com/PHP/Scripts_and_Programs/index.html
RE: [PHP] Re: PHP Mysql Hit Counter
ah thanks. much appreciated. i did google and found a few things, but was really after something that someone else would recommend rather than trying a few hundred. :) regards m -Original Message- From: Nadim Attari [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 3:46 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP Mysql Hit Counter http://www.hotscripts.com/PHP/Scripts_and_Programs/index.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Move
Found this for anyone interested. http://www.mysql.com/doc/en/INSERT_SELECT.html John Taylor-Johnston wrote: I was wondering about this, but decided to ask first first: INSERT INTO ccl.ccl_main VALUES (select * from greid.ccl where id=28); delete * from greid.ccl where id=28; Both tables would have to have the same structure ? -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Move
I was wondering about this, but decided to ask first first: INSERT INTO ccl.ccl_main VALUES (select * from greid.ccl where id=28); delete * from greid.ccl where id=28; Both tables would have to have the same structure ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql report builder
http://www.phplens.com/ might be something you could use. Michael P. Carel [EMAIL PROTECTED] wrote in message 002d01c295b8$f0301800$[EMAIL PROTECTED]">news:002d01c295b8$f0301800$[EMAIL PROTECTED]... hi to all; sorry for posting this mysql question again. im searching for a report builder for mysql specifically for creating reports for invoice/receipt..etc. just like crystal reports and oracle report builder. or is there any suggestion to do it in PHP . any idea? thanks in advance Regards, mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql not mutually connected
In article 003001c28a86$cab1dce0$[EMAIL PROTECTED], [EMAIL PROTECTED] says... I have php (as an apache module) and mysql up and running on Windows in the same computer, but they seem to be unconnected. How do I configure php.ini, my.ini, etc for a php script to find and query a database in the mysql server? Thanks for any help Alberto Brea Your installation probably has mysql support enabled - use phpinfo() to check. Then see http://www.php.net/manual/en/ref.mysql.php for all the mysql functions which will do what you want. Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: PHP + MySQL, how to get total rows matched when using LIMIT 0, 10?
I'm trying to get the total matched rows when I'm using LIMIT 0, 10, but I only get the number 10, when the total should be around 100. So, can I get total matched rows without doing a separate query using count()? You first have to get the whole result set without the limit OR make use of count(*) and parse the result of count. Since it only returns 10, it's correct the the total matched rows is 10. sql query Regards, Jeroen Geusebroek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MYSQL query error
I did some more testing and I found that I forgot the first field in the columns section of the Statement. So now it looks like this: I also copy and pasted the statement into PHPMYADMIN and it worked fine. It just doesn't work here function AddSignupRequest($Signup_FName, $Signup_LName, $Signup_Address1, $Signup_Address2, $Signup_City, $Signup_State, $Signup_Zip, $Signup_Email, $Signup_Phone, $Signup_ContactMethod, $Signup_Date, $Signup_IP, $Signup_Status, $Signup_Comments) { /* Connecting, selecting database */ $dbh=mysql_connect ($MySQL_Host, $MySQL_User, $MySQL_Password) or die ('I cannot connect to the database.'); mysql_select_db (havasuin_Signups); /* Performing SQL query */ $query = INSERT INTO SignupRequests ('SignupID', 'FirstName', 'LastName', 'Address1', 'Address2', 'City', 'State', 'Zip', 'Email', 'Phone', 'ContactMethod', 'Date', 'IP', 'Status', 'Comments') VALUES ('', 'Chris', 'Crane', '655 Talcottville Road', 'Apt. 185', 'Vernon', 'CT', '06066', '[EMAIL PROTECTED]', '860-659-6464', 'Email', 'August 25, 2002', '64.252.232.82', 'Newly Requested', 'Testing'); $result = mysql_query($query) or die(Query failed); /* Free resultset */ mysql_free_result($result); /* Closing connection */ mysql_close($link); print br$Signup_LName, $Signup_FNamebr\n; } Chris Crane [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am getting a failed query error message. Could someone take a look and let me know. //F U N C T I O N S //= function AddSignupRequest($Signup_FName, $Signup_LName, $Signup_Address1, $Signup_Address2, $Signup_City, $Signup_State, $Signup_Zip, $Signup_Email, $Signup_Phone, $Signup_ContactMethod, $Signup_Date, $Signup_IP, $Signup_Status, $Signup_Comments) { /* Connecting, selecting database */ $dbh=mysql_connect ($MySQL_Host, $MySQL_User, $MySQL_Password) or die ('I cannot connect to the database.'); mysql_select_db (havasuin_Signups); /* Performing SQL query */ $query = INSERT INTO SignupRequests ('FirstName', 'LastName', 'Address1', 'Address2', 'City', 'State', 'Zip', 'Email', 'Phone', 'ContactMethod', 'Date', 'IP', 'Status', 'Comments') VALUES ('', 'Chris', 'Crane', '655 Talcottville Road', 'Apt. 185', 'Vernon', 'CT', '06066', '[EMAIL PROTECTED]', '860-659-6464', 'Email', 'August 25, 2002', '64.252.232.82', 'Newly Requested', 'Testing'); $result = mysql_query($query) or die(Query failed); /* Free resultset */ mysql_free_result($result); /* Closing connection */ mysql_close($link); print br$Signup_LName, $Signup_FNamebr\n; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL Search Engine Query Question
I am currently working on a website that is implemented using PHP and MySQL. The site currently has a simple search engine that allows a shopper to type in a search string that is stored in $search. For example, if a shopper types in 1972 Ford Mustang $string =1972 Ford Mustang Using the following SQL statement: SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search% Records are returned that have this exact string and in this exact order (I'm aware a wild card character is included on the front and back of the string). My desire is to be able to logically AND each token of the search together independent or the order of the tokens. I want to return all records that have Mustang AND 1972 AND Ford. Since a shopper inputs the search string in advance I don't know how many tokens will be used. How about using OR and a ranked sorting so that the more words that match, the better? ?php if (!isset($start)){ $start = 0; # Or is it 1? MySQL/PostgreSQL do it differently. G. } $words = explode(' ', $search); $query = select whatever, 0 ; while (list(,$word) = each($words)){ if (trim($word)){ $query .= + whatevercolumn LIKE '%$word%' ; } } $query .= as score ; $query .= from sometable ; $query .= where score 0 ; $query .= order by score desc ; $query .= limit $start, $limit ; ? Since LIKE returns TRUE/FALSE, when you add them up they turn into 1/0, and you get a one-point score for each matching word. -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP-MySQL connection problem
My server is running on shared server which has support for PHP 4.1.2. I installed mySQL for our shared server. I also installed phpMyAdmin. Both are running properly. But I am facing following problems 1) If there is any error in the script - It is not getting displayed - screen is becoming blank, so it is becoming very difficult for me to make out any mistake. Check the php.ini values (or use ?php phpinfo();? to see what your values are for error_reporting and error_logging and display_errors. Your errors may be going into the Apache error log or even some other separate log where they belong. If so, your ISP is to be commended for their vigilance and Security focus. 2) I am trying to send email - but not getting any email. This is the script ? $mailBody = This is one line \ n This is a second line \n\n this is a third line; For one thing use \r\n not just \n. Spec. $boolMail = mail ([EMAIL PROTECTED], Test mail, $mailBody); print (Email has been send ); ? I am getting print statement but not the mail. Any extra settings are required ? if ($boolMail){ print Email has been queued.BR\n; } else{ print Couldn't even queue email, much less send it!BR\n; } Check your sendmail logs to see what's going on. Also check the sendmail and SMTP settings in php.ini (or ?php phpinfo();? and see if they make sense. Also ask your ISP if PHP (user 'nobody', probably) is even *ALLOWED* to send email. Maybe not. If they were paranoid enough to fix the logging, they may have dis-allowed PHP to send email. -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql simple math
I have created a table which has a column called cost. How do I add up all the numerical data in the cost column and display that on a webpage? ?php $query = select sum(cost) from whatever where blah, blah, blah; $cost = mysql_query($query) or error_log(mysql_error()); $cost = mysql_result($cost, 0, 0); ? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL and parameterized queries
Does MySQL support parameterized queries (e.g., INSERT INTO table (Col1,Col2) VALUES (?,?)), and if so, is there a PHP function that allows you to create and attach parameters to MySQL queries? I don't believe MySQL supports that, so there's no PHP mechanism for it. However, you *can* insert a bunch of rows at once with something like: $query = insert into table (col1, col2) values (1, 2), (3, 4), (5, 6); I don't guarantee I got the MySQL syntax correct, though. This is, however, not supported under other database engines, so be aware that you'll need to alter it if you ever move to something other than MySQL. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP-MySQL AND Case Sentivity
That's Ok See : http://www.zend.com/tips/tips.php?id=199single=1 Fincom [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi, how to make sql Result case sensitive with php. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP-MySQL AND Case Sentivity
You can create the column with a BINARY flag to make it case-sensitive, or use blobs, which are case-sensitive by nature. You can also use the keyword BINARY to cast a column to case-sensitive in your query. From: http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html #Case_Sensitivity_Operators BINARY The BINARY operator casts the string following it to a binary string. This is an easy way to force a column comparison to be case-sensitive even if the column isn't defined as BINARY or BLOB: mysql SELECT a = A; - 1 mysql SELECT BINARY a = A; - 0 BINARY string is a shorthand for CAST(string AS BINARY). See section 6.3.5 Cast Functions. BINARY was introduced in MySQL Version 3.23.0. Note that in some context MySQL will not be able to use the index efficiently when you cast an indexed column to BINARY. If you want to compare a blob case-insensitively you can always convert the blob to upper case before doing the comparison: SELECT 'A' LIKE UPPER(blob_col) FROM table_name; We plan to soon introduce casting between different character sets to make string comparison even more flexible. ---John Holmes... -Original Message- From: fincom [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 5:43 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP-MySQL AND Case Sentivity That's Ok See : http://www.zend.com/tips/tips.php?id=199single=1 Fincom [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi, how to make sql Result case sensitive with php. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP+MySQL - Excel ?
Thanks to all :-) Bye, Evan Evan [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it possible to create an excel file with some data from mySQL, using PHP ? Thanks, Evan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP+MySQL - Excel ?
Hello, On 05/17/2002 01:18 PM, Evan wrote: Is it possible to create an excel file with some data from mySQL, using PHP ? Sure, you can use this class to generate Excel files on fly on even in non-Windows platforms. http://www.phpclasses.org/biffwriter -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP+MySQL - Excel ?
At 02:13 PM 5/17/2002 -0300, Manuel Lemos posted the following... Hello, On 05/17/2002 01:18 PM, Evan wrote: Is it possible to create an excel file with some data from mySQL, using PHP ? Sure, you can use this class to generate Excel files on fly on even in non-Windows platforms. Heck, outputting a tab-delimited file with a mime type of application/msexcel works too.. :) Glenn --- The original portions of this message are the copyright of the author (c)1998-2002 Glenn E. Sieb.ICQ UIN: 300395IRC Nick: Rainbear All acts of Love and Pleasure are Her rituals-Charge of the Goddess -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Hosting services
What's the URL of host.. Ahh za. I have seen them.. They also run a free php hosting service.. Yes ok but how much downloads/transfer off server do you get?? ::: Julien Bonastre [The-Spectrum.org CEO] A.K.A. The_RadiX [EMAIL PROTECTED] ABN: 64 235 749 494 Mobile: 0407 122 268 QUT Student #: 04475739 ::: - Original Message - From: Vins [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 15, 2002 7:12 AM Subject: [PHP] Re: PHP MySQL Hosting services Hey. I have the best hosting you can get. for only $46 p/m ALL THIS... 400 MB web space Execution of Custom CGI scripts Support for PERL Support for C and C++ Support for SSI Support for GCC Support for GD Support for 5 independent MySQL Databases Own URL in the format Extensive Support Forum 99,9% Uptime 24/7/365 Network Monitoring Power Back-up Generator Daily Back-ups Web Site Control Panel FTP User Login 25 POP3 Accessible Mailbox(es) Unlimited E-mail Aliases Online Mail Administration Tool Online Web Mailbox Advanced E-mail Forwarding E-mail Auto Responder Form to e-mail CGI script (cgiemail and formmail.pl) Access to CGI Counter and Counter Configurations Tool Daily Log Files Graphic Statistics Report Disk Usage Monitor Full range of MIME types Execution of PHP scripts (PHP4) Telnet Access (activated on request) SSH Access (activated on request) Microsoft Frontpage 2000 Extensions (activated on request) 5 Databases with MySQL CGI Shopping Cart Custom CGI Support for SSI Perl C, C++ GCC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL Hosting services
you get unlimited traffic. here it is very cheep. so they can offer a great service. www.wthosting.cjb.net and they also don't pay for a domain. so that means even more cheeper prices. LOL they crazy. I know they guy, his way of thinking is free is better for the client and for them client gets cheeper prices. they get more moeny. works, you should see what he drives The_radix [EMAIL PROTECTED] wrote in message 002801c1e481$34c849e0$3300a8c0@oracle">news:002801c1e481$34c849e0$3300a8c0@oracle... What's the URL of host.. Ahh za. I have seen them.. They also run a free php hosting service.. Yes ok but how much downloads/transfer off server do you get?? ::: Julien Bonastre [The-Spectrum.org CEO] A.K.A. The_RadiX [EMAIL PROTECTED] ABN: 64 235 749 494 Mobile: 0407 122 268 QUT Student #: 04475739 ::: - Original Message - From: Vins [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 15, 2002 7:12 AM Subject: [PHP] Re: PHP MySQL Hosting services Hey. I have the best hosting you can get. for only $46 p/m ALL THIS... 400 MB web space Execution of Custom CGI scripts Support for PERL Support for C and C++ Support for SSI Support for GCC Support for GD Support for 5 independent MySQL Databases Own URL in the format Extensive Support Forum 99,9% Uptime 24/7/365 Network Monitoring Power Back-up Generator Daily Back-ups Web Site Control Panel FTP User Login 25 POP3 Accessible Mailbox(es) Unlimited E-mail Aliases Online Mail Administration Tool Online Web Mailbox Advanced E-mail Forwarding E-mail Auto Responder Form to e-mail CGI script (cgiemail and formmail.pl) Access to CGI Counter and Counter Configurations Tool Daily Log Files Graphic Statistics Report Disk Usage Monitor Full range of MIME types Execution of PHP scripts (PHP4) Telnet Access (activated on request) SSH Access (activated on request) Microsoft Frontpage 2000 Extensions (activated on request) 5 Databases with MySQL CGI Shopping Cart Custom CGI Support for SSI Perl C, C++ GCC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL Hosting services
Vins wrote: you get unlimited traffic. here it is very cheep. so they can offer a great service. www.wthosting.cjb.net and they also don't pay for a domain. so that means even more cheeper prices. LOL they crazy. I know they guy, his way of thinking is free is better for the client and for them client gets cheeper prices. they get more moeny. So, that $14.95/year he saves on his own domain name is split between, what, 10 clients and each one is saving $1.50/year? Wow! That's over 10 cents per month he's saving his clients!. Maybe he should get rid of the phone lines too - that would save even MORE money, and mean even CHEAPER prices for people! There's no end to how much money he can save us! works, you should see what he drives Did he pay cash? Or is he leasing? Fake it till you make it is quite a popular lifestyle for many people. :) Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL Query Prob
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hey... new to the list, but didn't have time to lurk and watch the traffic, kind of in a bind here. I apologize in advance if I do something wrong... Using this code: ?php $link = mysql_connect() or die(Could not connect); mysql_select_db(mydb) or die(Could not select database); $result = mysql_query(SELECT * FROM cars WHERE year=1991); extract(mysql_fetch_array($result)); What is that line above for? It's probably swallowing your first record. Get rid of it. // while ($row = mysql_fetch_object($result)) { Use this to avail yourself of extract correctly while ($row = mysql_fetch_array($result)) { extract($row); // Not needed with extract $generation = $row-generation; // Not needed with extract $year = $row-year; // Not needed with extract $owner = $row-owner; // Not needed with extract $email = $row-email; // Not needed with extract $pic1 = $row-pic1; // Not needed with extract $tmb1 = $row-tmb1; printf(img src='%s'br, $pic1); printf(small%s/smallbr,$generation); printf(b%s/bbr,$year); printf(%sbr,$owner); printf(a href=mailto:'%s'%s/ap, $email, $email); printf(a href='%s'img src='%s' border=0/ap, $pic1, $tmb1); } /* Free resultset */ mysql_free_result($result); /* Closing connection */ mysql_close($link); ? I'm successfully able to retrieve and display information for year='1991'. It works great. However, if I replace '1991' with any other year that I KNOW there's a matching record for, I get no results. So if I were to replace year='1991' with year='1990', no results would be produced although the same query given directly in MySQL will give results. Make sense? This same problem happens with other fields too, it seems really selective. I can use WHERE color='red' and get results, but color='black' returns nothing, although there are matching records. Taking out the WHERE in the above code will return all but the first record in the table. I fixed that just by putting a dummy record first, but that still shouldn't be happening. Any ideas? I need to get this fixed but I'm not sure what's wrong! Try the mods above; make sure that you quote the year value if the year field is text, and perhaps stick in a mysql_error after your query to see if any eror is coming back from mysql. Is there any chance that you have stray white space in your year fields? If year is a char type and SELECT * FROM cars WHERE year LIKE '%1990%' works, you likely have stray junk in your db. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Hosting services
http://webpipe.net They seem to be doing good with uptime.. In the last couple months I've been having a monitoring service check them frequently and so far we're at 100%.. Standard Virtual Package ($24.95/mo - $14.95 setup): Linux RedHat 7.1 300mb Disk Space 25 POP3 Accounts 10GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Host up to 25 Apache VHosts Premium Virtual Package ($34.95/mo - $14.95 setup):: Linux RedHat 7.1 500mb Disk Space 50 POP3 Accounts 20GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Priority Technical Support Host up to 50 Apache VHosts Plus you get a free month credit for referring others.. Hint, hint.. (it's Bob Weaver, account: custompcweb.com) Later, Bob Weaver Jennifer Downey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everyone, I am wondering if anyone has a good hosting service? I am currently with Aletia which has an excellant package good tech support but sometimes not very functional servers. My site has gone down at least 3 times within the last 20 days. Too many for me. It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least 15 POP3 email accounts, cron support. Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL Hosting services
Check out linux web host comes with PHP and MySql Their PHP compile is pretty nice, including GD support. Their DB is run via phpMyAdmin. http://www.linuxwebhost.com http://webpipe.net They seem to be doing good with uptime.. In the last couple months I've been having a monitoring service check them frequently and so far we're at 100%.. Standard Virtual Package ($24.95/mo - $14.95 setup): Linux RedHat 7.1 300mb Disk Space 25 POP3 Accounts 10GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Host up to 25 Apache VHosts Premium Virtual Package ($34.95/mo - $14.95 setup):: Linux RedHat 7.1 500mb Disk Space 50 POP3 Accounts 20GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Priority Technical Support Host up to 50 Apache VHosts Plus you get a free month credit for referring others.. Hint, hint.. (it's Bob Weaver, account: custompcweb.com) Later, Bob Weaver Jennifer Downey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everyone, I am wondering if anyone has a good hosting service? I am currently with Aletia which has an excellant package good tech support but sometimes not very functional servers. My site has gone down at least 3 times within the last 20 days. Too many for me. It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least 15 POP3 email accounts, cron support. Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP MySQL Hosting services
Yeah, I actually used to have a couple accounts with linuxwebhost.com... They are nice and fast.. I just like the ability to be able to compile and install my own software on the server.. Later, Bob Eat Pasta Type Fasta [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Check out linux web host comes with PHP and MySql Their PHP compile is pretty nice, including GD support. Their DB is run via phpMyAdmin. http://www.linuxwebhost.com http://webpipe.net They seem to be doing good with uptime.. In the last couple months I've been having a monitoring service check them frequently and so far we're at 100%.. Standard Virtual Package ($24.95/mo - $14.95 setup): Linux RedHat 7.1 300mb Disk Space 25 POP3 Accounts 10GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Host up to 25 Apache VHosts Premium Virtual Package ($34.95/mo - $14.95 setup):: Linux RedHat 7.1 500mb Disk Space 50 POP3 Accounts 20GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Priority Technical Support Host up to 50 Apache VHosts Plus you get a free month credit for referring others.. Hint, hint.. (it's Bob Weaver, account: custompcweb.com) Later, Bob Weaver Jennifer Downey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everyone, I am wondering if anyone has a good hosting service? I am currently with Aletia which has an excellant package good tech support but sometimes not very functional servers. My site has gone down at least 3 times within the last 20 days. Too many for me. It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least 15 POP3 email accounts, cron support. Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Hosting services
Jennifer Check out Hub.Org Networking services http://www.hub.org They have Virtual Machine that can be configured to your NEEDS without affecting other clients and vice versa. and MANY other features including ssh, ftp, cgi/perl and I believe they have also added MySQL 3.23 to the list. Not sure if it would be what you want but they are good :) Jennifer Downey wrote: Hi everyone, I am wondering if anyone has a good hosting service? I am currently with Aletia which has an excellant package good tech support but sometimes not very functional servers. My site has gone down at least 3 times within the last 20 days. Too many for me. It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least 15 POP3 email accounts, cron support. Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Hosting services
Hey. I have the best hosting you can get. for only $46 p/m ALL THIS... a.. 400 MB web space a.. Execution of Custom CGI scripts a.. Support for PERL a.. Support for C and C++ a.. Support for SSI a.. Support for GCC a.. Support for GD a.. Support for 5 independent MySQL Databases Own URL in the format www.your-name.co.za Choice of local / int. server 30-Day Moneyback Guarantee Extensive Support Forum 99,9% Uptime 24/7/365 Network Monitoring Power Back-up Generator Daily Back-ups Web Site Control Panel FTP User Login POP3 Accessible Mailbox(es) 25 Unlimited E-mail Aliases Online Mail Administration Tool Online Web Mailbox Advanced E-mail Forwarding E-mail Auto Responder Form to e-mail CGI script (cgiemail and formmail.pl) Access to CGI Counter and Counter Configurations Tool Daily Log Files Graphic Statistics Report Disk Usage Monitor Full range of MIME types Execution of PHP scripts (PHP4) Telnet Access (activated on request) SSH Access (activated on request) Microsoft Frontpage 2000 Extensions (activated on request) Databases with MySQL 5 CGI Shopping Cart Custom CGI Support for SSI Perl C, C++ GCC begin 666 clip_image001.gif M1TE.#EA`*`*(``+^_OQ\?'S,S,V9F9@```/___P```'Y! `` M+ `*``H`0 ,A6+JL,$,L *Y.#B!B:#%T%W#\D33(HYE88U:`7#8U]P) `#L` ` end -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Hosting services
Hey. I have the best hosting you can get. for only $46 p/m ALL THIS... 400 MB web space Execution of Custom CGI scripts Support for PERL Support for C and C++ Support for SSI Support for GCC Support for GD Support for 5 independent MySQL Databases Own URL in the format Extensive Support Forum 99,9% Uptime 24/7/365 Network Monitoring Power Back-up Generator Daily Back-ups Web Site Control Panel FTP User Login 25 POP3 Accessible Mailbox(es) Unlimited E-mail Aliases Online Mail Administration Tool Online Web Mailbox Advanced E-mail Forwarding E-mail Auto Responder Form to e-mail CGI script (cgiemail and formmail.pl) Access to CGI Counter and Counter Configurations Tool Daily Log Files Graphic Statistics Report Disk Usage Monitor Full range of MIME types Execution of PHP scripts (PHP4) Telnet Access (activated on request) SSH Access (activated on request) Microsoft Frontpage 2000 Extensions (activated on request) 5 Databases with MySQL CGI Shopping Cart Custom CGI Support for SSI Perl C, C++ GCC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php/Mysql
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Just a noob php/mysql question... (I suppose) When I try just putting php code in my insert queries, it goes like this: insert into mytable values('?php echo some string; ?') select * from mytable, returns: ?php echo some string; ?Some string So the insert-query inserts both the code AND the string that the code echoes... Any help would be greatly appreciated! You haven't given enough code to know excatly what your problem is. However, for an educated guess, try something like: $sql = INSERT INTO mytable VALUES( . $mystring . ); where of course $mystring is the correctly formatted set of values to insert. Note that using this method you must have a value for each field in the table, in the order in which the fields appear in the table. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL Hosting services
http://webpipe.net They seem to be doing good with uptime.. In the last couple months I've been having a monitoring service check them frequently and so far we're at 100%.. Standard Virtual Package ($24.95/mo - $14.95 setup): Linux RedHat 7.1 300mb Disk Space 25 POP3 Accounts 10GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Host up to 25 Apache VHosts Premium Virtual Package ($34.95/mo - $14.95 setup):: Linux RedHat 7.1 500mb Disk Space 50 POP3 Accounts 20GB/mo transfer Static IP Address Apache 1.3.20 PHP 4.0.6 Dedicated MySQL Server CRON Telnet/SSH/FTP Sendmail SSL Webmin Control Panel Priority Technical Support Host up to 50 Apache VHosts Plus you get a free month credit for referring others.. Hint, hint.. (it's Bob Weaver, account: custompcweb.com) Later, Bob Weaver The_radix [EMAIL PROTECTED] wrote in message 010401c1e346$5e494300$3200a8c0@oracle">news:010401c1e346$5e494300$3200a8c0@oracle... wow.. 10-15gb.. where do you get that kinda hosting and for how much?? Here in Aus it'd cost you a packet.. Don't know where abouts in the globe you are though.. Here in AUS my host only gives me 1gb p/m and 50mb space... for AUD$399p/a that's USD$198... bit of a ripoff I think. but unbelievably they're one of the cheapest I have ever seen in AUS and best quality... ::: Julien Bonastre [The-Spectrum.org CEO] A.K.A. The_RadiX [EMAIL PROTECTED] ABN: 64 235 749 494 Mobile: 0407 122 268 QUT Student #: 04475739 ::: - Original Message - From: Jennifer Downey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 14, 2002 7:46 AM Subject: [PHP] PHP MySQL Hosting services Hi everyone, I am wondering if anyone has a good hosting service? I am currently with Aletia which has an excellant package good tech support but sometimes not very functional servers. My site has gone down at least 3 times within the last 20 days. Too many for me. It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least 15 POP3 email accounts, cron support. Thanks Jennifer -- The sleeper has awaken --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php + Mysql Hosting problem
To use php+mysql on spaceports you have to sign up for a cgi-bin account and store your files on that server.. /Micke Simonk [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have made a web site containing Php and Mysql script And I have applied for a free web hosting account in www.spaceports.com there are two folder i can use: Public_html Cgi-bin which one i should put mysql files in? and what user name and password should i use for connecting mysql server? the current setting is mysql_connect (localhost, Administrator); thank you! and which free hosting is recommanded for php + mysql? I can only found this spaceports free! Thank you very much! __ ¦èªù³½ SeeMon Simonk ICQ#: 25943733 Current ICQ status: + More ways to contact me i See more about me: __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php/Mysql
Myabe you should assign some string to a variable: $string = some string; insert into mytable values ($string) /Just a noob trying to help out Torkil Johnsen [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Just a noob php/mysql question... (I suppose) When I try just putting php code in my insert queries, it goes like this: insert into mytable values('?php echo some string; ?') select * from mytable, returns: ?php echo some string; ?Some string So the insert-query inserts both the code AND the string that the code echoes... Any help would be greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php