Jump to content
Larry Ullman's Book Forums

chop

Members
  • Posts

    192
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by chop

  1. With my form, I have the (radio buttons ) that ask "This is a business account" and "This is a personal account". (single select) If the user selects "This is a business account", then I want to ask for the business address and phone number. Else I want to skip these questions. Of course, the php $_POST[] won't work until the submit button is pressed at the end of the form. I can get the Value of the clicked radio button with javascript " onclick="check(this.value)" form within the form using a predefined js function. But, from what I understand, I can't pass the value of the js value to a php variable unless I do a page load first. Maybe the answer is using all js code, forget the php? thanks, Chop
  2. The power of the dark side, Windows hosting, is something I can feel even with my Mac and mySQl server turned off. But I will try some of these other options. The 'Abigail' proposal is interesting and will try that first. I think I've about rounded up all the information I need about this topic... just a matter of deciding a course of action. Thank you all for your assistance - as always it was so helpful to me. ciao fro now, Chop
  3. Yes, that's probably what will happen. Can you or others recommend such a host? Thanks, for all the help. Would never have thought it would have come to this!
  4. I'm trying to create a sort of "intake form" for a client who will be running mssql from their server. So I need my Mac to write and test the code locally by connecting to a "test" mssql server that is already set up for this purpose. I have to talk to mssql instead of the usual mySQL. Ultimately the php code that I write will be running from a server that is on the client's site whom will also be hosting their own sql database. My other option ( I thought) was to test the code on a host where I already have an account - hoping that their php had the proper ODBC. However, though they provide php/mySQL services, they do not provide for connecting to a ms sql server. Only mySQL. I hope this makes sense! Here is the latest response (FYI) from Actualtech (above): Hi Gary, I did a little investigation, and it looks as if neither MAMP nor XAMPP ship with the ODBC module included. The native version of Apache shipped with Mac OS X does include ODBC support, but MAMP and XAMPP do not. I'm afraid that's going to preclude anything we can offer you. If you're able to use an Apache installation that includes iODBC, you would be able to use the PHP odbc_connect() functions with our "Actual SQL Server" driver to perform queries against your MS SQL Server database: http://www.actualtech.com/phpsetup.php thanks, Chop
  5. I think the problem is the fact that I have a Macintosh. There's plenty of free support for Windows but have found nothing free and easy for the Mac. I have found many complex explanations of how to accomplish this but they all involve getting a ODBC driver and about 25 other steps which aren't easy to understand. There are no free drivers that I've found either. I went to Microsoft and only found drivers for Windows. Even after contacting tech support at: https://www.actualtech.com/buynow.php to see if their solution would work, the representative gave the following reply: ---------------------------------- Hi Gary, I'm going to pull some information together for you that hopefully will help you get connected using ODBC. In the meantime, I have a couple of questions for you: 1. Is your PHP (local and hosted) built with the iODBC module (i.e. does the function phpinfo() include a section for iodbc)? 2. Are you using shared hosting, or do you have your own dedicated server? Best regards, Jonathan Monroe Actual Technologies - ODBC for Mac OS X support@actualtech.com --------------------------------- I gave him the information a couple days ago but have not heard from him. #1 NO #2 SHARED HOSTING If anyone knows a link where I can simply get a free (above) driver, install it, and have it work with MAMP or XAMPP please let me know. I appreciate all the help here. Chop
  6. Okay, thank you. I installed XAMPP hoping that it might have more support features than MAMP. However, it still doesn't seem to want to connect to a ms sql server. 1. Paul, you mentioned that I might have to "'re-make' PHP". Can you explain more on that? 2. The php.ini in XAMPP file does not contain a line with "mssql.so". This is why I think that something needs to be installed somewhere. 3. Someone mentioned installing a product called "freetds"?? Also, someone suggested I invest $35 in an ODBC driver such as the one here: https://www.actualtech.com/buynow.php saying that this will provide the connectivity. I'm a little confused as to how all this relates to one another. How does PHP itself need to be modified and (if it is modified correctly - the necessary libraries etc,) do I still need an ODBC driver? OR if I have an ODBC driver, does PHP still need to be tweaked to work? I wish I had a better concept of how all it goes together. I Googled my brains out but I get bits and pieces that are hard to fit together. FYI, here is the code I am using to try and connect with the server: <?php ini_set('display_errors', 1);// displaying errors = true error_reporting(E_ALL);// show all types of errors $myServer = "johndoe.siriusware.net";// not the real server name,un, or pw $myUser = "myPass"; $myPass = "myPass"; $myDB = "SkiSwap"; //connection to the database $dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer");//code dies here CHOP
  7. That dark day is upon me. I knew it would eventually come but I was clipped from behind, never saw it coming. After becoming good friends with mySQL, this dark antagonist comes in the form of mssql server and how to access it, run procedures using my Microsoft un-savvy MAMP php MAMP 1.9.6 with php 5.3.5 (on a MAC). I found a few clues in the php.ini file that 5.3.5 is at least aware of the existence of ms sql server. Here is an snippet: -------------------------- ;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; ; ; If you wish to have an extension loaded automatically, use the following ; syntax: ; ; extension=modulename.extension ; ; For example, on Windows: ; ; extension=msql.dll ; ; ... or under UNIX: ; extension=msql.so ; ; Note that it should be the name of the module only; no directory information ; needs to go here. Specify the location of the extension with the ; extension_dir directive above. ; Extensions ;extension=apc.so extension=imap.so extension=yaz.so extension=mcrypt.so extension=gettext.so extension=pgsql.so extension=pdo_pgsql.so extension=pdo_mysql.so ------------------------------- There is also this: -------------------------------- [MSSQL] ; Allow or prevent persistent links. mssql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mssql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. mssql.max_links = -1 ; Minimum error severity to display. mssql.min_error_severity = 10 ---------------------------- You will note that I un-commented the "extension=msql.so" on the whim that this would somehow get me closer to giving my php understanding of commands like "mssql_connect($myServer, $myUser, $myPass)" but this did not happen. My Project is not big and simply requires running a few stored procedures from MS SQL. I'm obviously missing something, perhaps a library supplement for php. Any clue her will be greatly appreciated. thanks Chop
  8. Terry: The links you gave seem to be about creating the procedures, which I have done successfully. Calling them from within phpMyAdmin is the problem I now have (as per my last post). thanks for your response, Chop
  9. If all you have to do for your project is implement a user/registration/login datebase as part of a larger project AND THEN, once it is operational, you will never have to deal with it again (i.e. it's on to other non-programming stuff that you're more familiar with) then you might think about letting someone else handle just that part of it (sub contract it out). However if you see yourself as having to maintain or modify this in the future or do other similar projects (i.e. programming stuff) , stick with the book and use this forum. The more you learn, the more you will feel inclined to learn. I was in a similar circumstance as you when I started in the php/mySql thing. I learned enough so that I could take the examples in the this book and modify them (not that extensively in most cases) and have a system work the way I wanted. I only wrote php code from a blank screen in the beginning. From there it was a matter of looking at the code, comparing it to what was "coming out" of it and changing it bit by bit until it worked for me. This process, for me, was how I learned (non-linear as it was) php programming. If you are positive that you "just want to drive the car", then let someone else "fix it" (or build it) for you because it's not really a big project for someone with the skills. Then you can get on to more enjoyable things in life. Otherwise, stick it out for a while and "mess around" with the exercises in the book without taking it too seriously and you could find yourself learning (even enjoying) php/mySQL almost by accident. chop
  10. I am using Version 3.2.4 of phpMyAdmin and have, apparently, been successful in creating a stored procedure which I called "get_stuff". Now I'm trying to figure out how to CALL it from within the SQL window. I found this post by Larry - "I don't know what version of phpMyAdmin I used previously as I just upgraded. I'm now using phpMyAdmin 3.2.5 with PHP 5.3.2 and MySQL 5.1.44. It's using the mysql PHP extension. This time I could call the stored procedures using either the SQL tab or the SQL popup, so long as I named the database--CALL ecommerce2.select_sale_items(1)--and so long as I DID NOT select the database in phpMyAdmin first. In other words, I had to be on the phpMyAdmin home page to start. Clearly, phpMyAdmin is inconsistent about how it deals with stored procedures. " So I tried to follow it with: CALL practice2.get_stuff(12); naming the database, as advised, and doing it from the home page of phpMyAdmin. However I get the result: #1312 - PROCEDURE practice2.get_stuff can't return a result set in the given context thanks, chop
  11. Lots to think about here! (HartlySan) I don't have the full database structure yet, only part of it as a way to begin to think about how to do this. I will be using information from the skiSwap DB to populate my form BUT, I am told that I will not be reading and writing directly to the SQL database from my form page. Rather I will be interacting via a web service that somebody else is now putting together. The SQL guy hands off some stored procedures to the web service guy, he writes the service which I, the form guy, then consumes. This is almost all new to me. I'm getting too old for this I suppose if someone wanted to play with this you could make up any scenario of branching items and put them in an array. Thanks, Antonio, for the tip on Larry's advanced PHP book. I will study what you've written and see how it works. Thanks for all the help... That which doesn't kill us makes us stronger . Nietzsche chop
  12. Do you think there might be some code available for this that uses some sort of tree structure? Javascript perhaps. I'm not a Javascript programmer and would rather just purchase code or a web service rather than the time to develop this. This is actually for a ski-swap application where people have to input what they have for equipment: Alpine skis | what make of ski | what model | how long etc. It's very complicated and my brain is hurting from it. I realize the digression that might result here and won't go on forever. I am getting some good information from you though. thank you chop
  13. Yes, I understand that. To complicate things, I need for the user to be able to back up in the process to a given point and to continue from there -without having to start all over again.
  14. I'm trying to figure out how one would construct an HTML form that is complex. This is best illustrated by example: Suppose I want to ask you what brand of skis you own. The choices might be: Brand1 Brand2 Brand3 etc. Based on the Brand you select, I want to know what model you have: Model1 Model2 Model3 etc. There may be many brands and many models. So if you choose Brand1, I don't want you to have to look at the Models for the other brands. So, I guess, I must be looking for some kind of tree architecture. I've got two of Larry's books, PHP 5 - MySQL6 and Effortless e-commerce - but I didn't see any references to this Any suggestions on where to go from here? thanks, chop
  15. I have other "Larry" books but not the one that relates to this topic. So if this scenario happens to be answered in his book, let me know and I'll purchase it. I've been hired to design a form and mySQl database to accept donations for a non-profit (.org) from donors and to produce a "donor" page listing names and the level(gold,silver etc.) of their contribution. So I need to collect donor name,date, amount contributed etc (the usual). This isn't difficult involves a little manual input by an administrator of .org. After receiving the e-mail from payPal that $200 has been received from John Doe, one can go into the database and mark John Doe as having donated $200. Then the donation page on the .org site can be generated using the database information. The question is, is there any way that this can be automated so there's no need to due the manual input? You could just trust John Doe and ask him on the form how much he "intends" to donate and hope that he follows through. Of course we can see the potential problems here. Paypal isn't talking to the .org database and can't stick in the amount paid for us. Surely many others have run into this problem and I'm thinking that there's a way to do it somehow short of accepting credit card payments on the .org site -no thanks. appreciate any suggestions chop
×
×
  • Create New...