[PHP-DB] Interbase/PHP/Apache implimentation
Okay... ...I have been trying (and failing) to get Interbase to work with PHP, served up by Apache on a Win2K machine. Through a lot of headache and the process of elimination, I have succeeded in getting an SQL response from PHP, after eliminating any instructions for Apache to load the PHP module - using only the CGI interface. So, if I understand things, my problem has been that I've been attempting to get Interbase support from the PHP module for Apache, which won't work for one reason or another. If true, this comes as great relief, because I was beating my head against the wall trying to figure out where my php.ini file was misconfigured So my question is this: Can DBMS support be enabled using the extension=php_interbase.dll directive in the php.ini file (as opposed to MySQL, where support is built in) ONLY while in CGI mode? Will the distribution version of php4apache.dll not look at the php.ini file, to enable Interbase support? If that is the case, is there anywhere one might find a version of the php4apache.dll file which enables Interbase support? I will use CGI if I must, but my preference is to use the Apache Module Thanks in advance, --Jordan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] 'htaccess" method : how to modify passwords from PHP scripts ?
> > There is a fantastic class that takes care of writing .ht* files... look > > here: > > > > http://phpclasses.upperdesign.com/ > > > Couldnt find anything on writing .ht* files. Are you sure? I looked and originally had trouble finding the class there too. I think it is a mirror of a version of the following class: http://www.thewebmasters.net/php/Htpasswd.phtml I haven't had a chance to test it out, but I think this might be what you are looking for. Cheers. --JW -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re-using query result identifiers?
Does re-using a link identifier name free the resources used by the previous one? Consider this code: $result = mysql_result($query1); $result = mysql_result($query2); Is the memory used by $query1's results freed/overwritten by $query2's results? Even further, does calling mysql_free_results as below accomplish anything, or is it a waste? $result = mysql_result($query1); mysql_free_results($result); $result = mysql_result($query2); Love, Tom Yeeto Web Lackey http://www.tumyeto.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re-using query result identifiers?
Does anyone know anything about this? -Original Message- From: Jordan [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 4:58 PM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Re-using query result identifiers? Does re-using a link identifier name free the resources used by the previous one? Consider this code: $result = mysql_result($query1); $result = mysql_result($query2); Is the memory used by $query1's results freed/overwritten by $query2's results? Even further, does calling mysql_free_results as below accomplish anything, or is it a waste? $result = mysql_result($query1); mysql_free_results($result); $result = mysql_result($query2); Love, Tom Yeeto Web Lackey http://www.tumyeto.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] DB Abstraction
Hi, I thought it was about time I started using a db abstraction class. Problem is, there are so many out there that I don't which one to start using? I've heard of ADODB (I think). Anyone have any suggestions? Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Ordering Articles
Hi, I'm trying to build an article management system. Basically it will have normal artcile type things, a picture or two etc. The articles will be ordered by date by default, but I want to include the option of being able to order the articles if need be. i.e. say I add more artciles but i still want one of the older artIcles to be at the top of the list, how would I do that? I hope this is clear, Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Text Searches on MySQL
Hi, I'm putting together a db with articles in it. Would it be better to have two tables with the main text of the articles in it linked to a main article table or just chuck it all in together in one table. I want to be able to do a full text search on the articles. Any help please, Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Sessions in Functions
Hi, I have some code which I decided to make into a function. Some of the code updates a session var which holds the current time. It now does not work. // update session variable with new time session_register("LOGGED_IN['time']"); $LOGGED_IN['time'] = mktime(); Are there issues that I should be aware of when I use sessions like this? Thanks, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Login System with access levels
Hi, I've got a db with a username and password in it. I can let people log in, like SELECT * FROM table WHERE username = username AND password = password. But how can I add an access level column so that I can have different levels of security. So admin's can read everything, but users can only read certain sections. How could I add to my db and structure a query? Any ideas would be good, Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: [PHP] Query - Grouping Results
Doesn't seem to work, how would I print that out with PHP? On Monday 19 March 2001 13:52, you wrote: > how about something like > select distinct > name, > date_format(time, "%W %D %M %Y") as login > from > users, user_logins > where > user_logins.user_id = users.id > order by name,time > > > -Original Message- > From: Jordan Elver [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 19, 2001 1:43 PM > To: PHP Database Mailing List; PHP General Mailing List > Subject: [PHP] Query - Grouping Results > > > Hi, > I've got a table like: > > iduser_id ip time > 1 2 127.0.0.1 20010316105018 > > Etc, etc. > > I do a join on the this table and the users table to get the coresponding > username to user_id like this: > > SELECT users.name AS name, user_logins.ip AS ip, > UNIX_TIMESTAMP(user_logins.time) AS time FROM users, user_logins WHERE > user_logins.user_id = users.id ORDER BY time ASC > > How can I display the results grouped by username? > > So, I want to be able to display: > > Logins for John > > Thursday 10th > Friday 12th > Monday 23rd > > Logins for Bob > > Monday 1st > Tuesday 2nd > Saturday 31st > > Thanks for any help, > > Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Query - Grouping Results
Sorry, the query works fine, but how do I print it out to the browser so that it looks like: John Dates go here Bob Dates go here Gill Dates go here I hope that's clear, Thanks, Jord On Monday 19 March 2001 14:44, you wrote: > works fine for me. > what error do you get. > > > -Original Message- > From: Jordan Elver [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 19, 2001 2:39 PM > To: Jeff Armstrong > Cc: PHP Database Mailing List; PHP General Mailing List > Subject: Re: [PHP] Query - Grouping Results > > > Doesn't seem to work, how would I print that out with PHP? > > On Monday 19 March 2001 13:52, you wrote: > > how about something like > > select distinct > > name, > > date_format(time, "%W %D %M %Y") as login > > from > > users, user_logins > > where > > user_logins.user_id = users.id > > order by name,time > > > > > > -Original Message- > > From: Jordan Elver [mailto:[EMAIL PROTECTED]] > > Sent: Monday, March 19, 2001 1:43 PM > > To: PHP Database Mailing List; PHP General Mailing List > > Subject: [PHP] Query - Grouping Results > > > > > > Hi, > > I've got a table like: > > > > id user_id ip time > > 1 2 127.0.0.1 20010316105018 > > > > Etc, etc. > > > > I do a join on the this table and the users table to get the coresponding > > username to user_id like this: > > > > SELECT users.name AS name, user_logins.ip AS ip, > > UNIX_TIMESTAMP(user_logins.time) AS time FROM users, user_logins WHERE > > user_logins.user_id = users.id ORDER BY time ASC > > > > How can I display the results grouped by username? > > > > So, I want to be able to display: > > > > Logins for John > > > > Thursday 10th > > Friday 12th > > Monday 23rd > > > > Logins for Bob > > > > Monday 1st > > Tuesday 2nd > > Saturday 31st > > > > Thanks for any help, > > > > Jord -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Query - Grouping Results
Hi, I've got a table like: id user_id ip time 1 2 127.0.0.1 20010316105018 Etc, etc. I do a join on the this table and the users table to get the coresponding username to user_id like this: SELECT users.name AS name, user_logins.ip AS ip, UNIX_TIMESTAMP(user_logins.time) AS time FROM users, user_logins WHERE user_logins.user_id = users.id ORDER BY time ASC How can I display the results grouped by username? So, I want to be able to display: Logins for John Thursday 10th Friday 12th Monday 23rd Logins for Bob Monday 1st Tuesday 2nd Saturday 31st Thanks for any help, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Structure Question
Hi, I want to keep filenames of different kinds of media(real sudio, qt, mp3) for articles in a db table. Would it be best to store each kind of media in a different table like one table for real audio, one for quicktime, one for mp3. Or, would it better to store them all in the same table but with another table telling me what kind of file it is? Like: media table id | name | filename | type_id media types type_id | name Any ideas folks? Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Betr.: [PHP-DB] Structure Question
I thought that it was good db design to have no repeating data in your db but to use a relationship instead? Jord On Tuesday 27 March 2001 14:42, you wrote: > Jord, > > I don't see quite why you should want to use two tables, you can easily put > all the information in one table and have one column which holds the > filetype. There's (almost) no speed profit to put the information in > several tables. > > Have fun, > Maarten Verheijen > > >>> Jordan Elver <[EMAIL PROTECTED]> 27-03-01 13:37 >>> > > Hi, > I want to keep filenames of different kinds of media(real sudio, qt, mp3) > for articles in a db table. Would it be best to store each kind of media in > a different table like one table for real audio, one for quicktime, one for > mp3. Or, would it better to store them all in the same table but with > another table telling me what kind of file it is? > > Like: > > media table > > id | name | filename | type_id > > media types > > type_id | name > > Any ideas folks? > > Cheers, > > Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Structure Question
I am. Jord On Tuesday 27 March 2001 14:06, you wrote: > Why don't you just store the file names in a db? > > iets much easyer > > > Hi, > > I want to keep filenames of different kinds of media(real sudio, qt, mp3) > > for > > > articles in a db table. Would it be best to store each kind of media in a > > different table like one table for real audio, one for quicktime, one for > > mp3. Or, would it better to store them all in the same table but with > > another > > > table telling me what kind of file it is? > > > > Like: > > > > media table > > > > id | name | filename | type_id > > > > media types > > > > type_id | name > > > > Any ideas folks? > > > > Cheers, > > > > Jord > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: AW: [PHP-DB] Structure Question
Thanks for your advice. I think I'll go with that. Cheers, Jord On Tuesday 27 March 2001 15:10, you wrote: > I think you should store all files in a table with an extra table with the > filetypes (like you suggest in the end of your mail)!! In my opinion this > is a well designed database modell, 'cause you have only one table (instead > of 10 or twelve depending on the count of your datatypes), but you are able > to select over the filetyp criteria!! > > Stefan Siefert > > -Ursprüngliche Nachricht- > Von: Jordan Elver [mailto:[EMAIL PROTECTED]] > Gesendet: Dienstag, 27. März 2001 14:38 > An: PHP Database Mailing List > Betreff: [PHP-DB] Structure Question > > > Hi, > I want to keep filenames of different kinds of media(real sudio, qt, mp3) > for > articles in a db table. Would it be best to store each kind of media in a > different table like one table for real audio, one for quicktime, one for > mp3. Or, would it better to store them all in the same table but with > another > table telling me what kind of file it is? > > Like: > > media table > > id | name | filename | type_id > > media types > > type_id | name > > Any ideas folks? > > Cheers, > > Jord > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Best way to check if a query succeeded
Hi, i was just wondering what you guys do to check if a wquery suceeded or not? I know about mysql_num_rows() and mysql_affected_rows(), just wondered what you guys do? I normally do something like: $sql = "SELECT something FROM table"; $result = mysql_query($sql); if(@mysql_num_rows($result) > 0) { echo'Query Suceeded'; } else { echo'Query failed'; } Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Php form & row delete problems
I have a table that display's a list of users in a mysql db. In the table I have a echo " {$row[$username]}, {$row[$password}, {$row[$isactive]}; ( this is not the exact code but its pretty close. ) What I would like to accomplish is after query and print rows. Each row has a check box and if the box is checked and delete button is clicked it is passed to userdel.php which would take the user_id and delete row. Any help would be greatly appreciated. Vincent Jordan Technical Support Smart Parts, Inc. Loyalhanna Business Complex 100 Station Street Loyalhanna, PA 15661 800-992-2147 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Php form & row delete problems
I have tried this but somehow can not seem to get it working. I have incuded copy of the pages. thanks in advance for the assistance. ## start.php ( start page. calls DisplayUser.php with an ## Administrator Menu > User Information Username Password Department Active ## DisplayUser.php ( connects to db and returns users) ## function DoToAll(obj_input) { bol_is_checked = (obj_input.checked)?true:false for (x=0;x<obj_input.form.length;x++) { obj_input.form.elements[x].checked = bol_is_checked; } } Select All "; echo "{$row[username]}{$row[password]}{$row[department]}{$act}"; } } ?> ## DelUser.php ( deleted user and returns to start.php) ## $value) { $query = mysql_query('DELETE FROM acl where user_id = ' . $user_id) // commit query or die ("could not del user" . mysql_error()); } echo "Done"; ?> - Original Message - From: "Torsten Roehr" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 25, 2004 1:35 PM Subject: [SPAM] [PHP-DB] Re: Php form & row delete problems > "Vincent Jordan" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I have a table that display's a list of users in a mysql db. In the table > I > > have a echo " > > {$row[$username]}, {$row[$password}, {$row[$isactive]}; > > > > ( this is not the exact code but its pretty close. ) > > > > What I would like to accomplish is after query and print rows. Each row > has > > a check box and if the box is checked and delete button is clicked it is > > passed to userdel.php which would take the user_id and delete row. > > > > Any help would be greatly appreciated. > > Write your checkbox the following way: > echo ""; > > After submitting $_POST['users'] will be an array containing all selected > user ids. You can then just loop through and do your delete queries: > > foreach ($_POST['users'] as $user_id => $value) { > $query = 'DELETE FROM table where user_id = ' . $user_id; > // commit query > } > > Hope this helps, > > Torsten Roehr > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] 2 requests: validate 2 password fields as equal and rewrite data
Could someone instruct me or point me in the right direction. I would like to have a when submit it will check to se if password and password2 are = ( i do not want password2 to end up in POST on submit.) also i am trying to rewrite data from a tinyint. the tinyint will return 1 or 0, I have tried but can not seem to get it right. pretty much if it returns 1 i want display active where if 0 display not active. I have tried the following: $act = mysql_query("select isactive from acl where isactive '1'") if ($act) { while ($isact = mysql_fetch_array($act)) { echo "Active"; } } else { echo "Not Active"; } i have also tried: if $row[isactive] = '1' { echo "active"; } else { echo "Not Active"; } im suue i have screwed up the syntax somewhere. I have looked on google and picked thru several scripts i have found online but have been unsuccessful. aly help appriciated. Vinny
[PHP-DB] Re: [SPAM] RE : validate 2 password fields
I have the following code and it is not working. it will pass the info along. hwew is a copy of the entire code:. function Validate() { if (document.UserAddNew.username.value == '') { alert('Warranty Database:\nPlease Enter a Username\!'); document.UserAddNew.username.select(); return false; } if (document.UserAddNew.password.value == '') { alert('Warranty Database:\nPlease Enter a Password\!'); document.UserAddNew.password.select(); return false; } } function checkpasswords() { df=document.forms['UserAddNew']; if (df['password'].value==df['password2'].value) { // Passwords matched, clear password2, allow form to submit df['password2'].value=''; return true; else { alert('Passwords did not match'); return false; } } Username : Password : Re Type Password: Department: Managment Sales Tech Support Returns Other - Original Message - From: "Neil Smith [MVP, Digital media]" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, June 29, 2004 6:25 AM Subject: [SPAM] RE : validate 2 password fields > Attach onsubmit="return checkpasswords()" to your form tag. > > function checkpasswords() { > df=document.forms["DisplayUser"]; > if (df["password1"].value==df["password2"].value) { > // Passwords matched, clear password2, allow form to submit > df["password2"].value=""; > return true; > else { > alert("Passwords did not match"); > return false; > } > } > > Cheers - Neil > > > > > >Message-ID: <[EMAIL PROTECTED]> > >From: "Vincent Jordan" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Date: Sun, 27 Jun 2004 20:49:47 -0400 > >MIME-Version: 1.0 > >Content-Type: multipart/alternative; > > boundary="=_NextPart_000_0029_01C45C88.48576050" > >Subject: 2 requests: validate 2 password fields as equal and rewrite data > > > >Could someone instruct me or point me in the right direction. I would like > >to have a >name=password2> when submit it will check to se if password and password2 > >are = ( i do not want password2 to end up in POST on submit.) > > > > CaptionKit http://www.captionkit.com : Production tools > for accessible subtitled internet media, transcripts > and searchable video. Supports Real Player, Quicktime > and Windows Media Player. > > VideoChat with friends online, get Freshly Toasted every > day at http://www.fresh-toast.net : NetMeeting solutions > for a connected world. > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Printing selected characters (strcnt?)
I am trying to figure out how to select the first letter of from the form field print it then append by datetime. Here is an example: $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $name = $first_name . ' ' . $last_name $rma = ?strcnt($last_name), 1 . Datetime(?) // takes the 1st character from $last_name and adds datetime in format of 715041200 Thanks any help appreciated Vincent Jordan Technical Support Smart Parts, Inc. Loyalhanna Business Complex 100 Station Street Loyalhanna, PA 15661 800-992-2147 X 5617 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Rewrite value from form data
I have a form with a field for a telephone number. I would like to either apply some kind of formatting to force format of XXX-XXX- or rewrite after submit to insert - in 3 and 5 (or 6). Here is what I have for code: --Form- Home Phone: handler.php $home = $_POST['home_phone' I have tried str_replace() however im not using it correctly or it is not the correct string to use for this -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] DB table creation question
I am creating a database to keep track of our warranty returns. Currently we do not have anything to track warranty info besides a big excel file. I would like to keep customer data, product info and RMA data in separate tables but still keep them related. If I had table customers: custid Firstname Lastname Address Address2 City State Zip Phone Email And table RMA Rmaid Assignedto Loggedby Customerid Date Timespent Status Priority Closedby Completedby Dateclosed Billable Billed Cost Lastmodifiedby Lastmodifieddate What I want to ensure is that if john smith fills out an RMA request online a customer id is assigned to John, the RMA number is associated with Johns customerid and I need to figure out how to assign a product to John. Also if john has more than one product assign products so when I pull up Johns information I can see all of Johns products owned. I am running mysql latest version.. Any help would be greatly appriciated
[PHP-DB] RE: [SPAM] Re: [PHP-DB] DB table creation question
Does this seem to be correct? With this if value was inserted into a table will the tables with the FK's automatically be updated? Here is the DB design as I have it now. Let me know if all is correct please. CREATE TABLE customer_info ( cust_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, first_name varchar (50) NOT NULL, last_name varchar (50) NOT NULL, address varchar (50) NOT NULL, address2 varchar (50) NULL, city varchar (50) NOT NULL, state varchar (50) NOT NULL, zip varchar (50) NOT NULL, home_phone varchar (15) NOT NULL, work_phone varchar (15) NULL, other_phone varchar (15) NULL, email varchar (50) NOT NULL, ); CREATE TABLE product_info ( product_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, cust_id int (6) NOT NULL, model varchar (50) NOT NULL, serial varchar (20) NULL, FOREIGN KEY (customer_info_cust_id), REFERENCES customer_info(cust_id), ON UPDATE CASCADE ON DELETE RESTRICT, INDEX (cust_id), FOREIGN KEY (cust_id), REFERENCES customer_info(cust_id), ); CREATE TABLE warranty_info ( warranty_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, product_id int (6) NOT NULL, cust_id (6) NOT NULL, mfg_warranty tinyint (1) NOT NULL default '1', gold_warranty tinyint (1) NOT NULL default '0', gold_warranty_id int (16) NULL, FOREIGN KEY (customer_info_cust_id), REFERENCES customer_info(cust_id), ON UPDATE CASCADE ON DELETE RESTRICT, INDEX (cust_id), FOREIGN KEY (cust_id), REFERENCES customer_info(cust_id), FOREIGN KEY (product_info_product_id), REFRENCES product_info(product_id), ON UPDATE CASCADE ON DELETE RESTRICT, INDEX (product_id), FOREIGN KEY (prod_id), REFRENCES product_info (product_id), ); CREATE TABLE rma_info ( rma_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, assigned_to varchar (50) NULL, logged_by varchar (50) NULL, date datetime NOT NULL, time_spent datetime (6) NULL, status varchar (50) NOT NULL, priority varchar (50) NULL, closed_by varchar (50) NULL, completed_by varchar (50) NULL, date_closed datetime (6) NULL, billable tinyint(1)NULL, billed tinyint (1) NULL, cost varchar (6) NULL, last_modified_by varchar (50) NULL, last_modified_date datetime NULL, ); -Original Message- From: Matthew McNicol [mailto:[EMAIL PROTECTED] Sent: Sunday, July 18, 2004 5:46 PM To: Vincent Jordan Cc: [EMAIL PROTECTED] Subject: [SPAM] Re: [PHP-DB] DB table creation question use the mysql 'auto increment' on a 'int' 'customer_id' field to generate a unique customer id. the RMA number is associated with a 'customer_id' since the 'customer_id' field is in both the customers table and the RMA table. Note that currently you have 'custid' and 'Customerid' respectively which you should change so that they are uniform (it helps with database maintenance is foreign keys are spelt the same as the primary key equivalent). to assign a product to a customer, first create a products table which defines each product. each product would have a unique 'product_id'. second, create a table which will link the products (zero, one or more) a customer has selected to the 'rma_id'. such tables would have the following structure: table: product product_id product_desc ... table: rma_product rma_id product_id table: customer customer_id firstname lastname ... table: rma rma_id assignedto loggedby customer_id ... Do you follow? Do you understand in what order you should populate the tables and how you can now create SQL queries to get the information you need? Vincent Jordan wrote: > I am creating a database to keep track of our warranty returns. > Currently we do not have anything to track warranty info besides a big > excel file. I would like to keep customer data, product info and RMA > data in separate tables but still keep them related. > > If I had table customers: > custid > Firstname > Lastname > Address > Address2 > City > State > Zip > Phone > Email > > And table RMA > Rmaid > Assignedto > Loggedby > Customerid > Date > Timespent > Status > Priority > Closedby > Completedby > Dateclosed > Billable > Billed > Cost > Lastmodifiedby > Lastmodifieddate > > What I want to ensure is that if john smith fills out an RMA request > online a customer id is assigned to John, the RMA number is associated > with Johns customerid and I need to figure out how to assign a product > to John. Also if john has more than o
Re: [PHP-DB] DB table creation question
I think I may have gone over my head. I am fairly new to mysql and php. My host only allows access to mysql via phpmysql. I am used to using mysqlcc to connect to the db's and make changes. By default all tables created are MYISAM, when I try to input a INNODB table with foreign keys I either get syntax error or I believe it is errno(150). Anyhow, is there a piece of software or a webpage out there where I can input how I want the database to be made and it will spit out a .sql file that can be uploaded to phpmyadmin or would someone be kind enough to "hold my hand" as I attempt to create this with proper syntax myself. Another note, instead of using indexes and keys can I have tables relate to each other by php script or am I asking for trouble as it grows. This database will be small at first however I expect it to grow to over 5k of customer records after the third month and in stages of about 200 records monthly after that. Thanks for all the help everyone has provided thusfar. -Original Message- From: Matthew McNicol [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 3:08 AM To: Vincent Jordan Cc: [EMAIL PROTECTED] Subject: [SPAM] Re: [PHP-DB] RE: [SPAM] Re: [PHP-DB] DB table creation question at the moment if a value is say inserted into the 'warranty_info' table you are just checking that the 'product_id' or 'cust_id' already exists in 'product_info' and 'customer_info'. you still have to populate them first, otherwise the referential integrity will return an error when you insert into 'warranty_info'. similarly if you delete a record from 'warranty_info' you might actually delete the associated customer record. is this what you want? at the moment it looks like the 'rma_info' table is not linked to any other table? personally, I would not go so far as to specify 'FOREIGN KEY ... REFERENCES' or 'ON UPDATE CASCADE ON DELETE RESTRICT' in the create table code. I would use the application code to make sure a customer exists before referencing them in the 'product_info' or 'warranty_info' tables. similarly I would use the application code to delete table record out of each appropriate table. I would use the primary and secondary index assuming you are working with more than 100 records in each table. Vincent Jordan wrote: > Does this seem to be correct? With this if value was inserted into a > table will the tables with the FK's automatically be updated? Here is > the DB design as I have it now. Let me know if all is correct please. > > CREATE TABLE customer_info ( >cust_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, >first_name varchar (50) NOT NULL, >last_name varchar (50) NOT NULL, >address varchar (50) NOT NULL, >address2 varchar (50) NULL, >city varchar (50) NOT NULL, >state varchar (50) NOT NULL, >zip varchar (50) NOT NULL, >home_phone varchar (15) NOT NULL, >work_phone varchar (15) NULL, >other_phone varchar (15) NULL, >email varchar (50) NOT NULL, >); > CREATE TABLE product_info ( >product_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, >cust_id int (6) NOT NULL, >model varchar (50) NOT NULL, >serial varchar (20) NULL, >FOREIGN KEY (customer_info_cust_id), > REFERENCES customer_info(cust_id), >ON UPDATE CASCADE ON DELETE RESTRICT, >INDEX (cust_id), >FOREIGN KEY (cust_id), >REFERENCES customer_info(cust_id), >); > CREATE TABLE warranty_info ( >warranty_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, >product_id int (6) NOT NULL, >cust_id (6) NOT NULL, >mfg_warranty tinyint (1) NOT NULL default '1', >gold_warranty tinyint (1) NOT NULL default '0', >gold_warranty_id int (16) NULL, >FOREIGN KEY (customer_info_cust_id), > REFERENCES customer_info(cust_id), >ON UPDATE CASCADE ON DELETE RESTRICT, >INDEX (cust_id), >FOREIGN KEY (cust_id), >REFERENCES customer_info(cust_id), >FOREIGN KEY (product_info_product_id), > REFRENCES product_info(product_id), >ON UPDATE CASCADE ON DELETE RESTRICT, >INDEX (product_id), >FOREIGN KEY (prod_id), > REFRENCES product_info (product_id), >); > CREATE TABLE rma_info ( >rma_id int (6) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, >assigned_to varchar (50) NULL, >logged_by varchar (50) NULL, >date datetime NOT NULL, >time_spent datetime (6) NULL, >status varchar (50) NOT NULL, >
[PHP-DB] howto get PK id after INSERT??
I have a form to insert customer data into a table. The form goes to php page to input data to db hen uses header to go to a final page displaying customer's information. Is there a way to get the ID (custid PK UNIQUE AUTO_INCREMENT) from mysql after INSERT then pass to final page using urlencode to pull cust record? Here is snip from form, post page and final page FORM CustomerAddNew.php .. POST PAGE CustomerAddNew1.php ini_set('display_errors', 1); error_reporting(E_ALL &~ E_NOTICE); // Get information from CustomerAdNew.php and make into functions. $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $address = $_POST['address']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $home = $_POST['homephone']; $work = $_POST['workphone']; $other = $_POST['otherphone']; $email = $_POST['email']; // Connect, Select, and POST to database $connect = mysql_connect("**", "**", "**") or die ("unable to connect to database" . mysql_error() . "**"); $select = mysql_select_db("**") or die ("unable to connect to database" . mysql_error() . "**"); $send = mysql_query("INSERT INTO customerinfo (firstname, lastname, address, address2, city, state, zip, homephone, workphone, otherphone, email) VALUES ('$firstname', '$lastname', '$address', '$address2', '$city', '$state', '$zip', '$home', '$work', '$other', '$email')") or die ("unable to post data" .' ' . mysql_error() . ' '. "to table custinfo. Please contact your Administrator"); if ($send) { print ' Customer Added '; } else { print 'something went wrong'; } header("Location: UserMain.php"); >From here I would like to populate the page with data that was just entered. (example) Cust No Name Address Etc . . .
Re: [PHP-DB] howto get PK id after INSERT??
I think I got it correct got the most part. I am having a problem with the urlencode function I believe. On page CustomerAddNew1.php ( page than handles form data ) im using: $last_id = mysql_query("SELECT LAST_INSERT_ID() from customerinfo"); $last_id = urlencode ($last_id); header("Location: UserMain.php?custid='$last_id'"); and on the UserMain.php page I am using this to return the data: $cid = "$last_id"; ini_set('display_errors', 1); error_reporting(E_ALL &~ E_NOTICE); $connect = mysql_connect("") or die ("unable to connect to database" . mysql_error() . ""); $select = mysql_select_db("") or die ("unable to connect to database" . mysql_error() . "SPDATA"); $result = mysql_query("select * from customerinfo where custid='$cid'") or die (mysql_error("Unable to query database")); while ($row = mysql_fetch_array($result)) { $firstname = $row['firstname']; $lastname = $row['lastname']; I am not able to display the data that was just entered. If I change select * from customerinfo where custid=3 it will display row 3 data. Can someone point out where I went wrong? Thanks again for the help
[PHP-DB] search form w/ multiple fields
I have a form with firstname, lastname, phone, and email fields. I would like to search the database and return results to the same page in an iframe. I want to be able to search my just one or multiple. For example I can search by "firstname" with value of "john" and it will return all "john" rows in iframe or search "firstname" value "john" and "lastname" value "smith" and again will return all rows with data in iframe. I have tried this but don't think I am doing something correct: $result = mysql_query ("select * from customerinfo where firstname like '%".$_POST['firstname']."%' or '%".$_POST['lastname']."%' or '%".$_POST['phone']."%' or '%".$_POST['email']."%'"); I cant seem to figure out how to display. I have tried in the HTML but there was no return of data. This is my form: First Name: Last Name: Phone : Email : all of this is on the same page, the page is called search.php
[PHP-DB] MySQL software question
Is there a piece of software that will allow my to create MySQL databases and table relations in a graphical format without having to connect to the database? I am looking for something where I can "point and click" the creation of tables and easily create several relationships between tables ( kinda like in access ) and when in done it will create the .sql file? I prefer this to be a desktop application. Thanks
[PHP-DB] form results to email
We have to process almost the same information via email several times a day for customers to get items repaired. I would like to reply to their email with a .htm page containing a fill in form, on form action it will send an email. I have the form and page created, all is almost working. Im having problems with the mailto syntax. What I would like is just the values of the fileds to print on the return mail with out the field names. Keep in mind this .htm page will be sent to them in an email so all they have to do is fill in the form, hit submit and it will create a new message to be sent. Any help will be appreciated. Here is what ive got: RMA Request Instructions: To have products shipped to Smart Parts for repair you will need to have an RMA ( Return Mail Authorization ) number issued. To receive an RMA number please complete the following form: mailto:[EMAIL PROTECTED] REQUEST&body="FirstName".&body="LastName" etc...> First Name Last Name Address Address2 City State Zip Serial Number for markers only Product Name Select Product Old Shocker 03 Shocker Impulse MaxFlow Barrel Other Accessory Other Product Reason for return
RE: [PHP-DB] Re: form results to email
I wrote this, $message is not displaying. What am I doing wrong?? > -Original Message- > From: Torsten Roehr [mailto:[EMAIL PROTECTED] > Sent: Friday, July 30, 2004 2:52 PM > To: Vincent Jordan > Subject: RE: [PHP-DB] Re: form results to email > > > > -Original Message- > > > From: Torsten Roehr [mailto:[EMAIL PROTECTED] > > > Sent: Friday, July 30, 2004 2:12 PM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP-DB] Re: form results to email > > > > > > "Vincent Jordan" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > We have to process almost the same information via email > > several times a > > > day > > > > for customers to get items repaired. I would like to reply to their > > > email > > > > with a .htm page containing a fill in form, on form action it > > will send > > > an > > > > email. > > > > > > > > > > > > > > > > I have the form and page created, all is almost working. Im having > > > problems > > > > with the mailto syntax. What I would like is just the values of the > > > fileds > > > > to print on the return mail with out the field names. Keep in > > mind this > > > .htm > > > > page will be sent to them in an email so all they have to do > > is fill in > > > the > > > > form, hit submit and it will create a new message to be sent. > > > > > > Hi Vincent, > > > > > > wouldn't it be easier to point the form (action) to a web > > script that will > > > then email the values to wherever it needs to be sent? This > > would require > > > one less step from the user. > > > > > > Regards, Torsten Roehr > > > > Torsten, > > > > I guess it would be more simple. Could I for example > action="http://www.mydomain.com/email/something.php";> and have > > the values go > > to the page without the user opening an explorer window? > > Where do they view the form? Probably in Outlook or IE. Haven't tested > submitting a form within Outlook yet. Maybe you could try it out. Would be > glad to know what you experience. > > Thanks and regards, Torsten -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: form results to email
>I wrote this, $message is not displaying. What am I doing wrong?? Nevermind. I forgot to add method="post" to the html page. I have gotten it to work however I would like to add some formatting to the email. Sent. I currently have: $message = "$firstname $lastname ."; mail("[EMAIL PROTECTED]", "RMA Request", $message); I have tried to add some html such as "$firstname $lastname ..."; however when I do this there is nothing displated in the email message. I have also tried $message = echo "$firstname $lastname ..."; and got errors. So then I figured I would try a function. And tried this: Function prtmsg() { echo "$firstname $lastname ..."; } $message = prtmsg(); and again I get a bland email returned. Could someone kindly point out what im missing? Thanks Vinny -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] SQL Insert problem
Im having a problem inserting data. Ive looked over this again and again and can not find what ive missed. Everything else works besides the db insert. http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> "; $message = "$firstname $lastname $address $address2 $city $state $zip $phone $email $product $serial $gold $goldaccount $reason $rmanumber"; // Send email to support mail("[EMAIL PROTECTED]", "RMA Request", $message, $header); ?> http://www.w3.org/1999/xhtml";> Untitled Document RMA Request Sent Your RMA Number is Please include a note within your package with your shipping address, phone number and discription of the problem.When shipping Smart Parts reccomends insuring your package for the full replacment cost. We also advise purchasing tracking services if using the postal service. Ship your return to: Smart Parts, Inc ATTN Loyanhanna Business Complex 100 Station St. Loyalhanna Pa. 15661 Please allow up to one week for package delivery. For status information please call 800-992-2147 and ask for the returns department. Click Here to print this page Click here to return to RMA Request form
RE: [PHP-DB] SQL Insert problem
I have inserted '$address2', correctly in the row however it is still not putting the data in the table. I am not getting an error but I do believe I have correct syntax set to display problems. > -Original Message- > From: Hutchins, Richard [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 05, 2004 10:26 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] SQL Insert problem > > You're missing address2 in your list of values. This means that you have > an > unmatching number of column names and values in your query and that'll > make > the query bomb. > > Rich > > > > -Original Message- > > From: Vincent Jordan [mailto:[EMAIL PROTECTED] > > Sent: Thursday, August 05, 2004 10:25 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] SQL Insert problem > > > > > > Im having a problem inserting data. Ive looked over this > > again and again and > > can not find what ive missed. Everything else works besides > > the db insert. > > > > > > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > > > > > > > ini_set ('display_errors', 1); > > > > error_reporting (E_ALL & ~E_NOTICE); > > > > // Define > > > > $firstname = $_POST['firstname']; > > > > > > > > $lastname = $_POST['lastname']; > > > > > > > > $address = $_POST['address']; > > > > > > > > $address2 = $_POST['address2']; > > > > > > > > $city = $_POST['city']; > > > > > > > > $state = $_POST['state']; > > > > > > > > $zip = $_POST['zip']; > > > > > > > > $phone = $_POST['phone']; > > > > > > > > $email = $_POST['email']; > > > > > > > > $serial = $_POST['serial']; > > > > > > > > $product = $_POST['product']; > > > > > > > > $reason = $_POST['reason']; > > > > > > > > $gold = $_POST['gold_button_y']; > > > > > > > > $goldaccount = $_POST['goldaccount']; > > > > > > > > $rmanumber = $lastname{0}.date("ndyGi"); > > > > > > > > $connect = mysql_connect("SERVER ", "USER", "PASSWORD") or die > > (mysql_error()); > > > > $select = mysql_select_db ("spdata") or die (mysql_error()); > > > > $sql = "INSERT INTO rmarequest (firstname, lastname, address, > > address2, > > city, state, zip, phone, email, serial, product, reason, > > rmanumber)VALUES > > ('$firstname', '$lastname', '$address', '$city', '$state', > > '$zip', '$phone', > > '$email', '$serial', '$product', '$reason', '$rmanumber') or die > > (mysql_error())"; > > > > if (isset($_POST['submit'])) { > > > > $sql; > > > > } > > > > // Send and put in email message > > > > $htmlheader = "Content-Type: text/html; charset=us-ascii\n"; > > > > $htmlheader .= "Content-Transfer-Encoding: 7bit"; > > > > $header = $from; // set the from field in the header > > > > $header .= "\n"; // add a line feed > > > > $header .= "MIME-version: 1.0\n"; //add the mime-version header > > > > $header .= $htmlheader."\n"; > > > > $from = "From: RMA Request <[EMAIL PROTECTED]>"; > > > > $message = "$firstname $lastname > > > > $address > > > > $address2 > > > > $city > > > > $state > > > > $zip > > > > $phone > > > > $email > > > > $product > > > > $serial > > > > $gold > > > > $goldaccount > > > > $reason > > > > $rmanumber"; > > > > > > > > > > > > // Send email to support > > > > mail("[EMAIL PROTECTED]", "RMA Request", $message, $header); > > > > ?> > > > > http://www.w3.org/1999/xhtml";> > > > > > > > > Untitled Document > > > > > > > > > > > > RMA Request Sent > > > > Your RMA Number is > > > > Please include a note within your package with your > > shipping address, > > phone number and discription of the problem.When > > shipping Smart Parts > > reccomends insuring your package for the full replacment cost. > > > > We also advise purchasing tracking services if using the postal > > service. > > > > Ship your return to: > > > > Smart Parts, Inc > > > > ATTN > > > > Loyanhanna Business Complex > > > > 100 Station St. > > > > Loyalhanna Pa. 15661 > > > > > > > > Please allow up to one week for package delivery. > > > > For status information please call 800-992-2147 and ask > > for the returns > > department. > > > > Click Here to print > > this page > /> > > > > Click here to return to RMA Request form > > > > > > > > > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SQL Insert problem (SOLVED), Thanks!
Thank you all for the help. I can't believe I forgot something so simple yet crucial. Thanks again for all the help. Vinny > -Original Message- > From: John W. Holmes [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 05, 2004 11:04 AM > To: Vincent Jordan; [EMAIL PROTECTED] > Subject: [SPAM] Re: [PHP-DB] SQL Insert problem > > From: "Vincent Jordan" <[EMAIL PROTECTED]> > > > > > $sql = "INSERT INTO rmarequest (firstname, lastname, address, > > > > address2, > > > > city, state, zip, phone, email, serial, product, reason, > > > > rmanumber)VALUES > > > > ('$firstname', '$lastname', '$address', '$city', '$state', > > > > '$zip', '$phone', > > > > '$email', '$serial', '$product', '$reason', '$rmanumber') or die > > > > (mysql_error())"; > > Uhhh. where's mysql_query()??? > > $sql = "INSERT ..."; > > $result = mysql_query($sql) or die(mysql_error()); > > ---John Holmes... > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Intellectual property rights
This is a bit off topic however it may be something people here have or will have the unpleasant opportunity to deal with. The company I work for has been having a problem tracking our customers warranty information and have used paper for items sent in for repair. I on my own time had created a web based application in php that would make both issues paperless, and in my own opinion getter overall. Once complete I informed my supervisor of the application and asked if It could be shown to the vice president for review, with the condition that this is my application and I own all source and design of the application. My supervisor said he would need our IT department to look it over before it went to the VP. At the request of the IT department head I downloaded the files and sql dump of the database to the company's server. The next day I wad in the IT office talking with the director of IT and a 3rd party company about the functions and design of the application. Because they are all Microsoft weenies and cant admin a server unless they can point and click their way to a fix they said php would not be an acceptable language and mysql is not a proper database to run an application on. I informed them I could rewrite this in asp.net and place it on a mssql database. The IT director said they will be having the 3rd party company just take what I have made, convert it to asp and build off of it. I approached my supervisor about compensation for the work that was done since they are using my design. I was told "you gave it to IT, there is nothing I can do about it" I explained that this was given on the condition that it would be shown to the VP and in hopes that I would either gain a transfer to IT, be awarded a contract to provide the solution and maintenance, or maintain my current position with a slight raise and I will maintain and built onto the application. I went up the chain to my supervisors boss and explained to them what had happened and that since they are using my design and altering it to another language that I would like to be compensated for my work. I was told that I did nothing but give them an idea and they were really doing all the work since what I did was not good enough and their computers could not understand what I wrote. The IT dept refuses to run anything besides Win Servers using IIS. They will not install PHP ( too many hacker problems they say). Did I just screw myself? Do I have any protection of my design? Can I do anything? Thanks, Vinny
[PHP-DB] RE: [SPAM] RE: [PHP-DB] Intellectual property rights
Granted this is a legal question however it is more of a world experience question. Im sure at least one person on this list had some experience with this type of matter. Im just trying to see if I have a leg to stand on or if I should chalk it up to life lessons learned > -Original Message- > From: Ed Lazor [mailto:[EMAIL PROTECTED] > Sent: Monday, August 09, 2004 7:23 PM > To: 'Vincent Jordan'; [EMAIL PROTECTED] > Subject: [SPAM] RE: [PHP-DB] Intellectual property rights > > You're asking a legal question and should contact an attorney. > > > > -----Original Message- > > From: Vincent Jordan [mailto:[EMAIL PROTECTED] > > Sent: Monday, August 09, 2004 4:03 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] Intellectual property rights > > > > This is a bit off topic however it may be something people here have or > > will have the unpleasant opportunity to deal with. The company I work > > for has been having a problem tracking our customers warranty > > information and have used paper for items sent in for repair. I on my > > own time had created a web based application in php that would make both > > issues paperless, and in my own opinion getter overall. Once complete I > > informed my supervisor of the application and asked if It could be shown > > to the vice president for review, with the condition that this is my > > application and I own all source and design of the application. My > > supervisor said he would need our IT department to look it over before > > it went to the VP. At the request of the IT department head I downloaded > > the files and sql dump of the database to the company's server. The next > > day I wad in the IT office talking with the director of IT and a 3rd > > party company about the functions and design of the application. Because > > they are all Microsoft weenies and cant admin a server unless they can > > point and click their way to a fix they said php would not be an > > acceptable language and mysql is not a proper database to run an > > application on. I informed them I could rewrite this in asp.net and > > place it on a mssql database. The IT director said they will be having > > the 3rd party company just take what I have made, convert it to asp and > > build off of it. > > > > I approached my supervisor about compensation for the work that was done > > since they are using my design. I was told "you gave it to IT, there is > > nothing I can do about it" I explained that this was given on the > > condition that it would be shown to the VP and in hopes that I would > > either gain a transfer to IT, be awarded a contract to provide the > > solution and maintenance, or maintain my current position with a slight > > raise and I will maintain and built onto the application. > > > > I went up the chain to my supervisors boss and explained to them what > > had happened and that since they are using my design and altering it to > > another language that I would like to be compensated for my work. I was > > told that I did nothing but give them an idea and they were really doing > > all the work since what I did was not good enough and their computers > > could not understand what I wrote. > > > > The IT dept refuses to run anything besides Win Servers using IIS. They > > will not install PHP ( too many hacker problems they say). > > > > Did I just screw myself? Do I have any protection of my design? Can I do > > anything? > > > > > > Thanks, > > > > Vinny > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: [SPAM] Re: [PHP-DB] Intellectual property rights
Michael, I did not sign a contract, NDA, or any other paperwork when I was hired. Just the standard government IRS / Tax stuff. I do not work in the IT department nor does my position entail anything to do with IT, programming, or any other technical task besides answering email. > -Original Message- > From: Michael Gale [mailto:[EMAIL PROTECTED] > Sent: Monday, August 09, 2004 7:41 PM > To: [EMAIL PROTECTED] > Subject: [SPAM] Re: [PHP-DB] Intellectual property rights > > Hello, > > I am not sure what you could do .. but some companies have it in the > contract you sign that all software you create or > develop while you work for the company are property of the company. > > So you may have to prove that it was developed on your personal time not > company if you decide to take this further ... > which should not be to hard with the M$ people. > > Michael. > > > > > On Mon, 9 Aug 2004 19:03:24 -0400 > "Vincent Jordan" <[EMAIL PROTECTED]> wrote: > > > This is a bit off topic however it may be something people here have or > > will have the unpleasant opportunity to deal with. The company I work > > for has been having a problem tracking our customers warranty > > information and have used paper for items sent in for repair. I on my > > own time had created a web based application in php that would make both > > issues paperless, and in my own opinion getter overall. Once complete I > > informed my supervisor of the application and asked if It could be shown > > to the vice president for review, with the condition that this is my > > application and I own all source and design of the application. My > > supervisor said he would need our IT department to look it over before > > it went to the VP. At the request of the IT department head I downloaded > > the files and sql dump of the database to the company's server. The next > > day I wad in the IT office talking with the director of IT and a 3rd > > party company about the functions and design of the application. Because > > they are all Microsoft weenies and cant admin a server unless they can > > point and click their way to a fix they said php would not be an > > acceptable language and mysql is not a proper database to run an > > application on. I informed them I could rewrite this in asp.net and > > place it on a mssql database. The IT director said they will be having > > the 3rd party company just take what I have made, convert it to asp and > > build off of it. > > > > I approached my supervisor about compensation for the work that was done > > since they are using my design. I was told "you gave it to IT, there is > > nothing I can do about it" I explained that this was given on the > > condition that it would be shown to the VP and in hopes that I would > > either gain a transfer to IT, be awarded a contract to provide the > > solution and maintenance, or maintain my current position with a slight > > raise and I will maintain and built onto the application. > > > > I went up the chain to my supervisors boss and explained to them what > > had happened and that since they are using my design and altering it to > > another language that I would like to be compensated for my work. I was > > told that I did nothing but give them an idea and they were really doing > > all the work since what I did was not good enough and their computers > > could not understand what I wrote. > > > > The IT dept refuses to run anything besides Win Servers using IIS. They > > will not install PHP ( too many hacker problems they say). > > > > Did I just screw myself? Do I have any protection of my design? Can I do > > anything? > > > > > > Thanks, > > > > Vinny > > > > > > > > > -- > Michael Gale > Network Administrator > Utilitran Corporation > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: [SPAM] [PHP-DB] Global Peace output
You have no html link. Try echo " $company $webaddress" > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Sunday, August 22, 2004 5:33 PM > To: [EMAIL PROTECTED] > Subject: [SPAM] [PHP-DB] Global Peace output > > Dear friends, > > I have pasted table structure and > php script > > below, > > Output I am getting is company name and web address, > like pasted below > > > > Global Coalition For Peace > http://www.globalcoalitionforpeace.net/ > Physicians For Social Responsibility > http://www.psr.org/ > > However, I want output page to print,url with link to website, > With present script, its printing web address in table, however, onclick > it > doesn't take me to website. > > Any guidance, so that onclick, its takes, to website in "webaddress" > column, > please. > -- > > - > table structure > -- > > - > > mysql> use b > Database changed > mysql> describe comp; > ++--+--+-+-++ > | Field | Type | Null | Key | Default | Extra | > ++--+--+-+-++ > | id | int(5) | | PRI | NULL| auto_increment | > | company| varchar(100) | | PRI | || > | webaddress | varchar(100) | | PRI | || > ++--+--+-+-++ > 3 rows in set (0.00 sec) > > mysql> > -- > - > php script > - > > include 'menufile.php'; > ?> > // open the connection > $conn = mysql_connect("localhost", "", ""); > > // pick the database to use > mysql_select_db("b",$conn); > > // create the SQL statement > $sql = "SELECT * FROM comp ORDER BY company"; > > // execute the SQL statement > $result = mysql_query($sql, $conn) or die(mysql_error()); > > //go through each row in the result set and display data > while ($newArray = mysql_fetch_array($result)) { > // give a name to the fields > $id = $newArray['id']; > $company = $newArray['company']; > $company = $newArray['company']; > $webaddress = $newArray['webaddress']; > //echo the results onscreen between ""can also //type$id is and > &company > is > echo " $company $webaddress"; > } > ?> > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] php Form Validation help
have a form that I would like to validate before it is submitted to the DB. I am having trouble with a couple of sections. I have a select box with a listing of all the states, the first option is "Choose One" with a value of "0". Would this be the correct way to "validate" this field? $state = $_POST['state']; if ($state = 0) { print 'Please select your State'; } Second, another part of the same form I have fields for phone numbers, once the field is submitted I would like to join the 3 sections of areacode, nxx and prefix. I have done this to join them, is this correct? $phone = $_POST['p-areacode'] . - . $_POST['p-prefix']. - . $_POST['p-suffix']; The next question id for both phone number and area code. If I want to validate the zip code and ensure a minimum of X characters in the field, numbers only how would I do this? Would this be somewhat on the right track? If ($zip str >5) { print 'Please enter your Zip Code (EX. 77662)'; } And for the phone number I would assume I could use: If ($_POST['p-areacode'] str >3 ) { print 'Please enter your Area Code (EX. 77662)'; } I am still new with PHP, any help would be appreciated. Below is the code I have sofar:
[PHP-DB] Using sessions to gather visitor information
I am trying to track the users that visit one page on a site. I am having a couple of problems. The time seems to be 5 hours off. I do not have any tables as of yet what I would like to do is only count an ip address as one in a 24 hour period, if more than one visit then update visit count.I have played around with the time using date() and localtime(). Here is what I have sofar. ini_set('display_errors',1); error_reporting(E_ALL & ~E_NOTICE); session_start(); $_SESSION['ip_address'] = $IP; $_SESSION['user_agent'] = $Browser; $_SESSION['host_name'] = $Host; $_SESSION['visit_time'] = $now; $now = localtime(); $now = $now[2] . ":" . $now[1] . ":" . $now[0]; $IP = getenv(REMOTE_ADDR); $Browser = $_SERVER['HTTP_USER_AGENT']; $Host = getHostByName($IP); I have not setup tables yet but I think I will use this: vid init(5) not null auto_incriment ip varchar(25) null agent varchar(100) null host varchar(100) null time varchar(10) nul visitcount int(100) null when a visitor loads the page I can run this mysql_query(SELECT ip, time FROM tablename where ip=$_SESSION['ip_address'] and time=$_SESSION['visit_time']) I would like to query if $_SESSION['ip_address'] has visited in less then 24 hours then kill session and close mysql connection. If last visit was more than 24 hours update time and add +1 to visitcount. If new visit add to table. Once all done how can I properly clean up the session. I have tried the following bur get an error unset($_SESSION); session_destroy(); I tried this with a link to another page and got this error: Warning: session_destroy(): Trying to destroy uninitialized session in /home/content/html/killtest.php on line 5 I assume I forgot something. Any help would be appreciated.
[PHP-DB] RE: [SPAM] Re: [PHP-DB] Using sessions to gather visitor information
John and everyone else, thanks for all the help. Here is what I have for code. Again you help is greatly appreciated. "; echo $_SESSION['user_agent'] . ""; echo $_SESSION['host_name'] . ""; echo $_SESSION['visit_time'] . ""; } // look for db entry $IpSearch = mysql_query("SELECT ip, time FROM visitor where ip = {$_SESSION['ip_address']}"); $Results = mysql_fetch_row($IpSearch); if($Results) { // need to figure out how to check if time greater than 24 hours from now // if greater than 24 hours do: $UpdateVisit = mysql_query("UPDATE visitor SET time = '$_SESSION['visit_time']', visitcount = /* add +1 */ WHERE ip = $_SESSION['ip_address']"); } else { $InsertVisit = mysql_query("INSERT INTO visitor (ip, agent, host, time, visitcount) VALUES ($_SESSION['ip_address'], $_SESSION['user_agent'], $_SESSION['host_name'], $_SESSION['visit_time'], '1' "); ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Selecting Alphabetically
Hi, Could anyone point me in the right direction with this one please. I have a table of records wit a field of artists. I want to select all the records which begin with the letter a-h then i-p etc What is the best way to do this? Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Passing Arrays
Hi, How can I pass an array between two pages. I've tried using serialize and unserialize. But it doen't return an array. When I use gettype() on it, it say's that the typ-e is boolean? Any ideas? Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mysql_result()
Thanks for everyones help with this one, all suggestions appreciated. Cheers, Jord On Wednesday 04 April 2001 17:06, you wrote: > Jordan, > > If you know your result is going to product one row, try using: > > $row=mysql_fetch_array($result, MSQL_ASSOC); > // returns an assoc array where the field names are keys, field value is > value > > $id=row[id]; > $name=row[name]; > etc. > > Best regards, > Andrew > -- > Andrew Hill - OpenLink Software > Director Technology Evangelism > eBusiness Infrastructure Technology > http://www.openlinksw.com > > -Original Message- > > > From: Jordan Elver [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, April 04, 2001 11:46 AM > > To: PHP Database Mailing List; PHP General Mailing List > > Subject: [PHP-DB] mysql_result() > > > > > > Hi, > > If I knnow that a query will only retrun one row, can I do thiss (below) > > rather than using a while loop for one record? > > > > $id = @mysql_result($result, 0, 'id'); > > $name = @mysql_result($result, 0, 'name'); > > $email = @mysql_result($result, 0, 'email'); > > $address1 = @mysql_result($result, 0, 'address1'); > > $address2 = @mysql_result($result, 0, 'address2'); > > $town_city = @mysql_result($result, 0, 'town_city'); > > $postcode = @mysql_result($result, 0, 'postcode'); > > > > Cheers, > > > > Jord > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] mysql_result()
Hi, If I knnow that a query will only retrun one row, can I do thiss (below) rather than using a while loop for one record? $id = @mysql_result($result, 0, 'id'); $name = @mysql_result($result, 0, 'name'); $email = @mysql_result($result, 0, 'email'); $address1 = @mysql_result($result, 0, 'address1'); $address2 = @mysql_result($result, 0, 'address2'); $town_city = @mysql_result($result, 0, 'town_city'); $postcode = @mysql_result($result, 0, 'postcode'); Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Timestamps VS Date/Time Types
Hi, I'm getting a bit confused about what date types to use in my applications and MySQL db. I have used timestamps and I know how to format them, convert them and compare them etc but now I am about to build a calender type script and I'm not sure what to use. For example, if I insert a load of calender appointments into the table, how would I sleect all the events in a certain month (if the dates were timestamps) ? What are the advantages of timestamps over other date//time fileds and vice versa? Thanks for any help, Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Selecting Dates
Hi, I'm trying to select records based on dates. I have a table with dates in the format 2001-04-08 and I'm using the query: SELECT name, description, date_time FROM events WHERE YEAR(date_time) = 2001 AND MONTH(date_time) = 04 AND DAYOFMONTH(date_time) = 08 But it doesn't yield any records? I don't really understand why? It seems to be the last bit 'DAYOFMONTH(date_time) = 08' which cause a problem because if I leave it out of the query, it selects all records for a particular month in a particular year as expected. Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Retrieving and Printing Categories
Hi, I've got a load of records that are in different categories. What is the best way to get all the records or selected records and print them in such a way that they are grouped (on the page) in their relevent category, like: Fruit -> Apples -> Pears -> Bananas Vegetables -> Carrots -> Cabbages etc, etc. Sometime my categories are ina dfferent table, don't know if this matters? How can I do this? TIA, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Checking query suceeded
Hi, If I'm doing more than one query on a page what is the best way to check if they all succeeded with out using transactions? TIA, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Printing out usernames and logins
Doh, stupid me. Thanks very much for your help. Your a life saver. Cheers, Jord On Monday 14 May 2001 8:49 am, you wrote: > ¥es, U R overwriting Ur result-set from the 1st qry. > > Store instead the 1st result into an array and iterate > it then, sending your second select. U can also use 2 > connections, but ... ? > > Greetinx, > Mike > > Michael Rudel > - Web-Development, Systemadministration - > ___ > > Suchtreffer AG > Bleicherstraße 20 > D-78467 Konstanz > Germany > fon: +49-(0)7531-89207-17 > fax: +49-(0)7531-89207-13 > e-mail: mailto:[EMAIL PROTECTED] > internet: http://www.suchtreffer.de > ___ > > > -Original Message- > > From: Jordan Elver [mailto:[EMAIL PROTECTED]] > > Sent: Monday, May 14, 2001 7:35 PM > > To: PHP DB List; PHP General List > > Subject: [PHP-DB] Printing out usernames and logins > > > > > > Hi, > > I'm trying to print out a list of usernames and the times > > they logged in. > > > > I want to print it out like: > > > > joe > > fred > > frank > > > > Then when you click on one of the names it show just there > > login times, like > > this, so if I click on fred it prints out: > > > > joe > > fred > > - > > - > > - > > frank > > > > But it doesn't continue printing out the rest of the > > usernames after it's > > finished printing freds logins. > > > > Any ideas would be appreciated. > > > > The code seems to have something to do with the second query, > > I think > > > > > > The code I'm using is below. > > > > Thanks, > > > > Jord > > > > db_connect(); > > $sql = "SELECT id, username FROM users"; > > $result = @mysql_query($sql); > > > > if(@mysql_num_rows($result) > 0) { > > > > echo'This is a list of Members who have Logged In to > > their account with > > times and dates:'; > > > > while(list($id, $username) = mysql_fetch_array($result)) { > > > > echo" > HREF=\"$PHP_SELF?user=$username&id=$id\">$username\n"; > > > > if($username == $user) { > > > > $sql = "SELECT UNIX_TIMESTAMP(time) AS time FROM > > user_logins > > WHERE user_id = $id ORDER BY time DESC"; > > $result = @mysql_query($sql); > > > > while(list($time) = mysql_fetch_array($result)) { > > echo date('h:i a l d F', $time)."\n"; > > } > > } > > } > > > > } else { > > echo error('No one has Logged In yet!'); > > } > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Printing out usernames and logins
Hi, I'm trying to print out a list of usernames and the times they logged in. I want to print it out like: joe fred frank Then when you click on one of the names it show just there login times, like this, so if I click on fred it prints out: joe fred - - - frank But it doesn't continue printing out the rest of the usernames after it's finished printing freds logins. Any ideas would be appreciated. The code seems to have something to do with the second query, I think :-( The code I'm using is below. Thanks, Jord db_connect(); $sql = "SELECT id, username FROM users"; $result = @mysql_query($sql); if(@mysql_num_rows($result) > 0) { echo'This is a list of Members who have Logged In to their account with times and dates:'; while(list($id, $username) = mysql_fetch_array($result)) { echo"$username\n"; if($username == $user) { $sql = "SELECT UNIX_TIMESTAMP(time) AS time FROM user_logins WHERE user_id = $id ORDER BY time DESC"; $result = @mysql_query($sql); while(list($time) = mysql_fetch_array($result)) { echo date('h:i a l d F', $time)."\n"; } } } } else { echo error('No one has Logged In yet!'); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] delete user but keep the article
Well I suppose that if you had a lot of users in your users table editing and adding articles then there could be a performance hit, but I don't know about this. Maybe someone else hasmore experince. How many users were you planning on? HTH, Jord On Wednesday 15 August 2001 05:42, you wrote: > Thanks for replying, Jordan. > > > So when I want to delete a user, in fact, > > I just set the status of that user to be dormant so that I can still get > > the > > > user information for displaying the article. Workls if your not going to > > have > > > loads of users. > > but what if i have loads of users? and why can't i use this approach? > > rudy -- Jordan Elver Web Developer The InternetOne UK Ltd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Most Read Article
Hi, I'm trying to get the most read article out a table. The table has a title column, a read column and some others. So I wanna SELECT the title from the table and the most read figure. I tried: SELECT title, MAX(reads) FROM articles This only gets the second most read article?! If I take out the title like: SELECT MAX(reads) FROM articles Then it gets the top article number but obviously not the title. Can anyone shed some light? Cheers, Jord -- Jordan Elver Web Developer The InternetOne UK Ltd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] SQL Injection attack
NOTE: http://www.php.net/mysql_escape_string "Version: 4.3.0 Description: This function became deprecated, do not use this function. Instead, use mysql_real_escape_string()." Jordan On Aug 25, 2005, at 2:15 PM, <[EMAIL PROTECTED]> [EMAIL PROTECTED]> wrote: Using mysql_escape_string should be good enough by itself. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] maximum number of records in a db?
I was just wondering what is the maximum number of records that can be successfully handled with a db. any db will do. it doesn't have to be the fastest or best, just one that can hold the maximum number of records and still be able to interact well with php. any ideas? thanks, Jordan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] maximum number of records in a db?
i am talking about individual records, not putting all records into a very long string, if that's what you are saying. i know people routinely use millions of records... but how about billions or more? Jordan On Aug 26, 2005, at 10:29 AM, Miles Thompson wrote: At 12:11 PM 8/26/2005, Jordan Miller wrote: I was just wondering what is the maximum number of records that can be successfully handled with a db. any db will do. it doesn't have to be the fastest or best, just one that can hold the maximum number of records and still be able to interact well with php. any ideas? thanks, Jordan This is a useless question. Here's the matching answer: The number of records any database can hold matches the length of a piece of string. Seriously - do some homework, visit the host sites and read the specs. A lot depends on what you intend to store. As for "interacting well" - push the string. MT -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: maximum number of records in a db?
Dan, Wow, thank you very much for an actual answer. It is much appreciated. I am sorry that people like to ridicule noobs on this list. It was a simple question with a simple answer. Thank you!! Jordan On Aug 26, 2005, at 10:45 AM, Dan Baker wrote: "Jordan Miller" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I was just wondering what is the maximum number of records that can be successfully handled with a db. any db will do. it doesn't have to be the fastest or best, just one that can hold the maximum number of records and still be able to interact well with php. any ideas? Using MySQL with PHP: I believe that a MyISAM table has a maximum row count of 2^32 (4,294,967,296) rows. I believe that an InnoDB table *may* not have this limit. PostgreSQL: There is no limit on the # of rows in a table, see: http://www.postgresql.org/docs/faqs.FAQ.html#4.4 Remember that there are other limits (like diskspace, and the time it takes to perform a query on the data, indexing the data ...) If you are concerning about the row limit, you may need to re-think the problem. DanB -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Brain not working, help needed :-)
you can also do this to save room without having to create $varname: ${"id".$num} = "some text"; Jordan On Aug 29, 2005, at 12:10 AM, Micah Stevens wrote: Hi Chris, You can use variable variables.. like this: $num = 2 $varname = "id".$num; $$varname = "id2 is stored here!"; It's in the docs in the variables section.. HTH, -Micah On Sunday 28 August 2005 11:45 pm, Chris Payne wrote: Hi there everyone, I have the following code: while ($row = mysql_fetch_array($sql_result)) { $id = $row["id"]; $video_link = $row["video_link"]; $video_thumbnail = $row["video_thumbname"]; $video_title = $row["video_title"]; $video_description = $row["video_description"]; }; Now I’ll be shifting through my MySQL array 6 items at a time, what I’d LIKE to be able to do is store each item in a number string on each pass. In other words, the first loop would see $id being called something like $id1, the second pass in the loop it would be $id2 and so on. I THOUGHT I could do this by putting a $count ++ in the loop and then doing something like $id$count or something like $id.$count but neither worked, this may sound odd but I REALLY need to be able to do this so how can I name a string that has to contain the data from a row successively higher on each loop so that it doesn’t overwrite the data on the previous loop? I have 6 items on the page so I can hardcode for item 1 and for item 2 etc …. But with the layout of the page being able to do it THIS way would be MUCH better than having to set the table itself up to handle it. Any help on this (Probably very easy) but annoying problem would be REALLY appreciated ;-) Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Storing an array on a table?
if you just have a simple array with automatic numeric keys and text you could just implode the data to a string with a separator not found in your data: $dataArray = array("hello", "goodbye", "etc."); $storable = implode("", $dataArray); // $storable becomes "hellogoodbyeetc." //then, use explode to get the original array back again $dataArray = explode("", $storable); you could use a similar technique if you want to put the keys in as well, albeit slightly more complicated (e.g. use "" to separate each element in the array and "||" to separate each key from its value). Just find a divider you know your data will not contain, such as a pipe: "|". This has worked well for me. Jordan On Sep 1, 2005, at 8:55 AM, Miguel Guirao wrote: I want to store an array into a field on a MySQL table, Is it posible to save it? Maybe into a string field? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Storing an array on a table?
Yes, this has been mentioned in this thread. But with serialize/ unserialize, you can run into other problems that may be more confusing/difficult to troubleshoot. e.g.: http://www.php.net/serialize >As you can see, the original array : >$arr["20041001103319"] = "test" > >after serialize/unserialize is: >$arr[683700183] = "test" yepp, and i can explain it. the internal compiler of php does not hit anys rule wich foces him to make that number a string during serialisation. since it becomes an integer and php supports 32bit interger not arbitary bitwidth this is what happens: "20041001103319" equals hexadecimal: 0x123A28C06FD7h if you cut away the frontpart cutting down to 32bis, you get: 0x28C06FD7h wich equals 683700183. For simple arrays, I prefer storing everything as a simple imploded string. YMMV. Jordan On Sep 1, 2005, at 10:18 AM, <[EMAIL PROTECTED]> [EMAIL PROTECTED]> wrote: Sorry, didn't catch this thread from the beginning, but did anyone recommend trying the serialize() and unserialize() commands? They'll convert the array to a block of text that can be stored, retrieved and unserialized. My gut instinct is that if you're trying to store any array in a database, you may not have thought through your design very well. BUT.. I also know that there are cases where you might want to (I've actually done it before... being lazy in that case..hah) so dont take that as criticism, just wondering if there's a "more right" way to do it. If that's what you need to do though, definitely check out serialize (unless someone knows something I don't). Serialize() should do essentially what's being proposed below, just without having to figure out what string may not be in your array. good luck! -TG = = = Original message = = = if you just have a simple array with automatic numeric keys and text you could just implode the data to a string with a separator not found in your data: $dataArray = array("hello", "goodbye", "etc."); $storable = implode("", $dataArray); // $storable becomes "hellogoodbyeetc." //then, use explode to get the original array back again $dataArray = explode("", $storable); you could use a similar technique if you want to put the keys in as well, albeit slightly more complicated (e.g. use "" to separate each element in the array and "||" to separate each key from its value). Just find a divider you know your data will not contain, such as a pipe: "|". This has worked well for me. Jordan On Sep 1, 2005, at 8:55 AM, Miguel Guirao wrote: I want to store an array into a field on a MySQL table, Is it posible to save it? Maybe into a string field? ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Help: Get the value of pi up to 200+ digits?
strange, with your code, mine cuts out at 49 significant digits: 3.141592653589793115997963468544185161590576171875 it must be a system-specific limitation. we need more information on what you are trying to do, *exactly*. be as detailed and specific as possible. On Sep 1, 2005, at 10:57 AM, Wong HoWang wrote: Dear Jordan, I know what you mean. But you may try this one and you will know: the result is the same as 16!!! So that's why I ask this question! I am not stupid like that! Please help, thx! "Jordan Miller" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] http://us3.php.net/manual/en/ini.core.php#ini.precision precision sets the number of significant digits, *NOT* the number of digits displayed after the decimal point. If you want to get pi out to 16 decimal places you need a precision of *17* because the beginning 3 is a significant digit. Your code does exactly this, displaying pi with 15 decimal places. Jordan On Sep 1, 2005, at 8:06 AM, Wong HoWang wrote: Dear all, I'm trying to do like this but failed: How can I get more digits after . ? Can anyone help? Thx! -- 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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] DATE(r)
You need to use: date('Y-m-d H:i:s'); It's in the comments at: http://www.php.net/date Jordan On Sep 9, 2005, at 12:52 PM, Ron Piggott wrote: Question: I am trying to for the first time create a table with a column that is defined as datetime I wanted to populate that column with the date(r) command. date(r) on my web site gives this response: Fri, 9 Sep 2005 13:32:19 -0400 How may I manipulate date(r) to give a format which is compatable to the column type -00-00 00:00:00 -MM-DD 24:59:59 Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: retrieving field names in ascending order
Does php have anything like the Visual Basic statement "Option Compare String" or "Option Compare Database" which controls how visual basic sorts strings like this.? If it does, then it might help *rushes off to check php manual* -- --- theExile.vze.com www.stpaulswalsall.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Question on CURDATE()
Rich, Did you try putting "WHERE" twice? try: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and WHERE END <= CURDATE; Jordan On Sep 13, 2005, at 9:08 PM, reclmaples wrote: I am trying to write a statement that will basically do this: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and END <= CURDATE; But for some reason I can only use one CURDATE() reference in my sql statement, does anyone know why? Is there a way I can get around this? Any help would be greatly appreciated. Thanks -Rich -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Question on CURDATE()
Micah, Oh, my bad. I was trying to remember how I did something like this before, stringing together a lot of "WHERE"s. You're right, though, it wasn't "WHERE", it was "OR". Rich, I think you need "OR" instead of "AND", OR else I'm just totally out to lunch tonight: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() OR END <= CURDATE(); The syntax error is that something cannot be >= AND <= the same thing at the same time! I have had this problem before in the past. You say to yourself, well, I need all of the records, so that intuitively makes you choose "AND" when in SQL it should technically be "OR" (you want the records that are true for each of these operators separately, NOT at the same time, which for most records is impossible). Also, you may want to take away one of the "=" signs, or you may get something "=" to CURDATE() twice (not sure how SQL handles this). Maybe try (taking out one of the "="): SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() OR END < CURDATE(); Maybe it's just late over here. Has anyone else run into this same thing? Jordan On Sep 13, 2005, at 10:36 PM, Micah Stevens wrote: You can't do that in SQL, that would give you a big fat syntax error. On Tuesday 13 September 2005 7:45 pm, Jordan Miller wrote: Rich, Did you try putting "WHERE" twice? try: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and WHERE END <= CURDATE; Jordan On Sep 13, 2005, at 9:08 PM, reclmaples wrote: I am trying to write a statement that will basically do this: SELECT * FROM WEEKS WHERE BEGIN >= CURDATE() and END <= CURDATE; But for some reason I can only use one CURDATE() reference in my sql statement, does anyone know why? Is there a way I can get around this? Any help would be greatly appreciated. Thanks -Rich -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Getting Started..
Man, he was just asking a simple question, no need to criticize every little aspect of etiquette. Please allow me to be a hypocrite and critique your criticism: 1) If his question gets buried in Yui's thread, no big deal, no one will answer and he will ask it again in a few days. If someone does answer, no second email needed. No harm, no foul. 2) No, the confidentiality notice is not *necessary* according to a strict definition. However, many people that work in the 'real world' actually have *no* control over this as it is automagically added to the end of every email leaving their email servers, **regardless** of user-settings. This is server-side code, not client-side. No harm, no foul. And yes, as you can probably tell by now, I don't have a problem with top posting either. I apologize if I have offended someone. Nevertheless, no need to point me to the Usenet diatribes... you won't sway me. Jordan On Sep 19, 2005, at 7:26 PM, Miles Thompson wrote: People don't like top posting, but I'm doing it for a reason. See what's at the end 1. Clint - Don't hijack threads. Some people use threaded mail clients, and your "getting started" will end up under Yui's thread. 2. Is it *necessary* to have a confidentiality notice that's just about equal in bulk to your message? If it's part of a canned sig, why not create a little simple one for this list. On to your question. Since you don't have all the code posted here, I suspect something is going on earlier in the file. Maybe you have an opening PHP tag, and a line without a semi-colon to terminate it. Why not try again, with just a single line file: Once that works, then expand it. Regards - Miles Thompson -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Getting Started..
Maybe you don't need the trailing semicolon after the phpinfo()? This is just a thought as sometimes you don't need it in the final php statement before the ?> tag. Mark On 20/09/05, Clint Lovell <[EMAIL PROTECTED]> wrote: > I'm just getting started here and I'm working with PHP & MySQL for Dummies. > The book says to write a simple file called "test.php" with the following > entries in it: > > > PHP Test > > > This is an HTML line > > echo "This is a PHP line"; > phpinfo(); > ?> > > When I run http://localhost/test.php, this is the error I got: > Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in > C:\apachefriends\xampp\htdocs\test.php on line 9. > Can someone tell me what's wrong and what I need to do to get things squared > away? > Thank you... > Respectfully, > > Clinton E. Lovell > Principal > Rainmaker Marketing Corporation > 15519 Dawnbrook Drive > Houston, Texas 77068 > (281) 537-1200 > (206) 203-1229 (eFax) > > CONFIDENTIALITY NOTICE: This communication and any documents, or files, > attached to it, constitute an electronic communication within the scope of > the Electronic Communication Privacy Act, 18 USCA 2510. This communication > may contain non-public, confidential, or legally privileged information > intended for the consideration of the designated recipients(s). The unlawful > interception, use, or disclosure of such information is strictly prohibited > by 18 USCA 2511 and any applicable laws. If you have received this e-mail in > error, please immediately notify us at (281) 537-1200 or via reply email and > permanently delete the original and any copy of any e-mail, file or > attachment and destroy any printout thereof. Thank you for your assistance. > > > -Original Message- > From: Norland, Martin [mailto:[EMAIL PROTECTED] > Sent: Monday, September 19, 2005 2:04 PM > To: php-db@lists.php.net > Subject: RE: [PHP-DB] insert error for mysql > > One of the strings you're inserting has an quotation mark (apostrophe). > You're going to have to do some more careful data scrubbing on the > incoming data. > > E.G. one of the strings says "it's used in the retail, banking, and > insurance industries, among" ... > And it's breaking the containing ' - insert into foo (bar) values > ('this isn't going to work.'); > > might I suggest starting with addslashes() > > Cheers, > - Martin Norland, Sys Admin / Database / Web Developer, International > Outreach x3257 > > The opinion(s) contained within this email do not necessarily represent > those of St. Jude Children's Research Hospital. > > > -Original Message- > From: Yui Hiroaki [mailto:[EMAIL PROTECTED] > Sent: Monday, September 19, 2005 1:26 PM > To: php-db@lists.php.net > Subject: [PHP-DB] insert error for mysql. . > > hi! > > I have an error message to try to insert character into table. > But I have an error messages like below. When I try to insert > $strbuf, I got error. > > > Could not perform INSERT to table 1064: You have an error in your SQL > syntax. Check the manual that corresponds to your MySQL server version > for the right syntax to use near 's used in the retail, banking, and > insurance industries, among > > > > I publish SQL; > > mysql> create table view(b_col_id mediumint(255) NOT NULL > AUTO_INCREMENT, b_col longblob NOT NULL,file_name varchar(255) NOT > NULL,file_size varchar(255) NOT NULL,file_type varchar(255) NOT > NULL,file_date time,vtext longtext,PRIMARY KEY(b_col_id))TYPE=MyISAM; > > > mysql> alter tablev view add fulltext (vtext); > > The code-- > $handle = popen("/usr/bin/pdftotext \"$original_tmp\" - -layout 2>&1", > 'r'); > $strbuf = fread($handle, 2048000); > echo $strbuf; > > pclose($handle); > > > $sql_insert = "INSERT INTO > view(b_col,file_name,file_size,file_type,file_date,vtext) VALUES > ('$binaryContent','$original_name','$original_size','$original_type',CUR > TIME(),'$strbuf')"; > > mysql_query($sql_insert) or DIE ("Could not perform INSERT to table > ".mysql_errno().": ".mysql_error()); > mysql_close($db); > > > > > > > Please do help me! > > Yui > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- theExile.vze.com www.stpaulswalsall.org.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HTML Tables in PHP...
boo ... short tags though i admit it's gotta be easier to type. Why I don't like short tags : I use XML a lot. Mark On 26/09/05, Micah Stevens <[EMAIL PROTECTED]> wrote: > > Rasmus, there's a shortcut for this: > > > > > > Saves me a lot of time, although it can be confusing for those unfamiliar with > it. > > -Micah > > > On Sunday 25 September 2005 11:01 pm, Rasmus Lerdorf wrote: > > There are many ways to do it. I prefer one of these two: > > > > > echo << > > > EOB; > > ?> > > > > or. > > > > width=""> > > > > -Rasmus > > > > Micah Stevens wrote: > > > I apologize, I was being rude. > > > > > > More specifically, I don't see why you say all html tags should be in > > > single quotes. There's several ways you can do things in almost every > > > situation in PHP, and I can just as easily say you should always use > > > double quotes. I of course would be wrong though. > > > > > > echo ""; > > > > > > provides the convenience of inserting variables: > > > echo ""; > > > > > > which you can not do with single quotes, so I could argue that double > > > quotes are better. > > > > > > So, in contrast to my original rude comment (again, I apologize) perhaps > > > I should of said: Why do you say that? > > > > > > -Micah > > > > > > On Sunday 25 September 2005 9:44 pm, Micah Stevens wrote: > > >>That's ridiculous. > > >> > > >>On Sunday 25 September 2005 9:28 pm, balwant singh wrote: > > >>>all html tags should be in single quote when used in php like > > >>> > > >>>echo ''; > > >>>echo ''; echo "HELLO"; > > >>>echo ''; > > >>> > > >>> > > >>> > > >>>With Best Wishes > > >>> > > >>>Balwant Singh > > >>> > > >>>INDO ASIAN FUSEGEAR LTD. > > >>>A-39, HOSIERY COMPLEX > > >>>PHASE - II EXTN., NOIDA > > >>>PH: +91 - 120 - 3048140 / 304 > > >>>FAX: +91 - 120 - 2568 473 > > >>>WEB : www.indoasian.com > > >>> > > >>> > > >>> > > >>> Original Message > > >>>From: "Daryl Booth" <[EMAIL PROTECTED]> > > >>>To: php-db@lists.php.net > > >>>Subject: [PHP-DB] HTML Tables in PHP... > > >>>Date: 9/25/2005 19:05 > > >>> > > How can I give a with all of it's parameters in PHP in > > each of the cells there is a variable that gives me the data back but I > > can't get the table to show as it always gives me either this error > > "Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' > > in C:\FoxServ\www\Dad\proofing\index.php on line 41" or this one when I > > don't put in the quotes "Parse error: parse error, unexpected '<', > > expecting ',' or ';' in C:\FoxServ\www\Dad\proofing\index.php on line > > 41". > > > > > > > > Here is the PHP code I'm using: > > > > > > > > > > > $datei="c:\licence.txt"; > > > > > > > > > > > > if(file_exists($datei)){ > > > > $nachricht="The licence has been validated thank-you!"; > > > > $fp = fopen($datei,"r"); > > > > fpassthru($fp); > > > > fclose($fp); > > > > } > > > > else{ > > > > $nachricht="The licence doesn't exist please contact us! > > > > echo > cellpadding="0" cellspacing="0"> > > > > > > > > > height="109" border="0" usemap="#Map"> > > > > > > > > > > > > > height="394"> > > > > > > > > > > > > > > > > > class="style3">$nachricht > > > > > height="394" border="0" usemap="#Map2"> > > > > > > > > > > > > > height="23"> > > > > > > > > ; > > > > } > > > > ?> > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- theExile.vze.com www.stpaulswalsall.org.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL 5 Stored Procedures
Ive heard that mysql 5 now supports stored procedures. Can you call these from PHP? or is it too early to expect functionality already? Mark -- This message is best viewed with your eyes. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL 5 Stored Procedures
Thanks a lot. Ive just been reading them up on the MySQL website, and they seem really useful, so this really helps. Mark On 03/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > It is possible using PHP 5. Simply make a query like this: > > Select name_of_procedure(parameter1,parameter2,...); > > We use this with phpcvs from april 2005 and the mysqli interface and it > works fine. -- This message is best viewed with your eyes. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] var_dump and sizeof database entry?
Hello, This is stumping me something awful. I have searched the archive of this mailing list and google and the php and mysql websites with everything i can think of. I have a simple mysql table with some basic columns and a blob column that holds an image file. What I need to get is the size of this image file for use with an rss feed (the enclosure "length" parameter). In the simplest case, I thought I would just read the entire blob into a variable, and then I would be able to get the size of this variable. However, php does not seem to have a function to do this. Inexplicably, the "var_dump" command will actually dump the information I want, but it is very memory inefficient, because I get something like: ["preview"]=> string(17888) "ENTIRE CONTENTS OF BLOB HERE" where all I really want is the 17888 value (for a 17.5 KB file). What I was wondering is if there is a simple way to get this information from mysql directly without having to 1) select the blob column and 2) do a var_dump with output buffering and parsing for the parenthetical file size, which seems very inefficient to me. any insight is greatly appreciated. Jordan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] var_dump and sizeof database entry?
whoa, that was EXACTLY what I needed. Thanks!! Jordan On Jan 5, 2006, at 6:14 PM, Bastien Koert wrote: select *, (length(image_fiedl)/1024) as Kb from table [where clause] to get the size Bastien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] retaining and displaying line returns in a text field
The function you need is called nl2br: http://us2.php.net/nl2br -Jordan On Jan 6, 2006, at 5:34 AM, swoll2 wrote: Good morning - I'm trying to get a text field with line returns in it to be stored, retrieved, and displayed the way it gets entered. Specifically, my users use a form field (html textarea) to enter some remarksas they enter their remarks, they can hit Enter to insert a hard return, which is reflected in the textarea on their screen. Example entry: this is line1. this is line2. this is line3. Those remarks get uploaded into a mysql db, into a field defined as a text field named rmks. If I use PhpMyAdmin to browse the table, it shows the entry with the lines separated, but there are no /n's or other control characters visible. Later, the field is retrieved from the db using a php script and assigned to a variable $rmkswhen I echo $rmks, it displays on a single line without the line returns, like this: this is line1.this is line2.this is line3. I have tried to work with addslashes and stripslashes, but neither has worked. I think I'm just missing something basic Appreciate any help or points to previous discussions..thanks...Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Hyperlinking to a new page
City Name Shiloh Madsen wrote: Ok, I know this should be easy, but im just blanking on how to do it. I have a webpage where you put in a city name, and it queries a database of all the cities in the US and brings back all cities matching that name. This part works just fine. What I want to do now is to create a hyperlink for each city name which, when clicked on will then call up a second page listing the details of that city. What I need to do is pass this page the city id (or any other identifying variable) to the detail page, but I cant for the life of me remember how to pass the data from one page to another outside of a form. Any help would be appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Hyperlinking to a new page
Yes.. J Shiloh Madsen wrote: actually theres a problem with this, the page returned usually has several returns in it, so i cant hand code the id in there, will it work to do "page.php?city_id=$city_id"? - Original Message - From: "Jordan S. Jones" <[EMAIL PROTECTED]> To: "Shiloh Madsen" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, October 09, 2003 4:48 PM Subject: Re: [PHP-DB] Hyperlinking to a new page City Name Shiloh Madsen wrote: Ok, I know this should be easy, but im just blanking on how to do it. I have a webpage where you put in a city name, and it queries a database of all the cities in the US and brings back all cities matching that name. This part works just fine. What I want to do now is to create a hyperlink for each city name which, when clicked on will then call up a second page listing the details of that city. What I need to do is pass this page the city id (or any other identifying variable) to the detail page, but I cant for the life of me remember how to pass the data from one page to another outside of a form. Any help would be appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Unique Format
Tonya, If the handle is only for display purposes in Html, you should look into the htmlentities () or htmlspecialchars () functions. htmlentities: http://www.php.net/htmlentities htmlspecialchars: http://www.php.net/htmlspecialchars Jordan S. Jones Tonya wrote: PHP 4.3.3 and MYSQL I am constructing a site for gamers that has a member registration form with field 'Game Handle'. Gamers are funny in that their game alias can include just about any character you can imagine. Setting up an ereg for this would be quite difficult. However, I *do* want to protect my site from any malicious data entry. I have tried to strip_tags this field, but many gamers put their team tags in their handle or use < and > characters within the name, so an input like "Jester" results in the team being taken out and only Jester being left. While that is not so bad, if the user inputs a name like GD, it changes the name signficantly. Anyone have any suggestions on how I can format the game handle variable so that it allows these characters while not leaving my site subject to malicious input? Thanks! -- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jordan+S.+Jones&no_note=1&tax=0¤cy_code=USD -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] how to deal with this (hack) attack?
On top of that, kill phpMyAdmin all together from the server. "How do I update my database architecture?" Using a combination or ssh port forwarding and a local Management Client. MySQL Front (Win32) - http://mysqlfront.venturemedia.de/index.php?act=ST&f=1&t=2&s=1a1c5747443deb838a59b393fd11ccc7 CocoaMySQL (OSX) - http://cocoamysql.sourceforge.net/ MySQLCC (Linux) - http://www.mysql.com/products/mysqlcc/index.html Jordan Peter Monk wrote: Merlin wrote: I am running a medium size php/mysql website. In the last days I recieved more and more mysql errors due to url tempering. Now my website went down for at least 5 minutes, or more detailed the database server mysql 3.x went down. In the apache logs I found requests like "connection:close" comming from unspecified clients. Change your mysql username privileges so that logins can only come from localhost. Make sure the phpmyadmin conf file isn't visible to outsiders - it has your mysql database passwords in it. Consider using deparate usernames/passwords for each mysql database, so that if a password becomes known, only one database is open to attack. Make sure you have no usernames/passwords visible in plain text form in any world-readable files. Assuming that hackers aren't able to access known usernames/passwords, they may use brute force attacks to guess user/password combinations, so make sure your usernames aren't obvious and that your passwords are strong (ie, not words from a dictionary, combination of numbers and letters, uppercase/lowercase, etc.). My understanding (limited) is that connections closing isn't necessarily a sign of illicit behaviour, depending on which log file they're in and the context of their appearance. If you think you're a target, change all your passwords (in case they are known) and tighten your security. Peter. -- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jordan+S.+Jones -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php