Jump to content
Larry Ullman's Book Forums

Duke

Members
  • Content Count

    52
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Duke

  1. RE: checkout.php...p 301 step17...just showing a work around that works at this stage of chp 10 could not get this line to return the id...$r = mysqli_query($dbc, 'SELECT @cid'); as a result there is no value to store in list($_SESSION['customer_id']) = mysqli_fetch_array($r);...(even reworked the stored procedure for add_customer..no luck My work around: I set $cid = mt_rand(100000,1000000000); added customer_id column to customer's table.... changed the stored procedure=add_customer...to also include customer_id...and....VALUE.... $cid changed setting session to: $_SESSION[
  2. I Found my error.....My error was that I did not have a "product_id" column in my CARTS Table Thank you.
  3. Hi RE: Chapter 9 cart.php... the following code.. //display carts contents $r = mysqli_query($dbc, "CALL get_shopping_cart_contents('$uid')"); if(!$r) echo mysqli_error($dbc); is causing this error on page Unknown column 'c.product_id' in 'on clause' I went over my stored procedure...could not find an error..resorted to copy and pasting stored procedure from book download.....My question is could my error still b
  4. Thank you for your help Larry... I had an error in my stored procedure...
  5. Hi Chapter 8 index.php-home page Display where a few items on sale are show I am using $r = mysqli_query($dbc, 'CALL select_sale_items(true)');.....this is not formatting the price(ie 500) I change to $r = mysqli_query($dbc, 'CALL select_sale_items(false)');...this is formatting the price(ie$5.00) I am thinking there is an error in my select_sale_items stored procedure in the IF beginning section.. I have not found the error.. My Question is... Could I be not seeing the error in this stored procedure? Thank you
  6. Hi RE: mod_rewrite rule If mod_rewrite is working for coffee and goodies..Providing code is correct...mod_rewrite should also work for sales...Correct? Here is the re_write I am using for sales #For sales: RewriteRule ^shop/sales/?$ /sales.php Thank you
  7. Yes Sorry Larry..Yes still having problem... ...I did notice in the book for the below line in the ipn.php script ... txn_type uses 'web_accept' if(($_SERVER['REQUEST_METHOD'] === 'POST') && isset($_POST['txn_id']) && ($_POST['txn_type'] === 'web_accept')) When I log into paypal and go Instant Payment Notification details (below is how to get there) Profile->My Selling tools->ipn->click-update->IPN History page->Message ID-Click I am getting back two messages. one____IPN type Transaction made.......USES....txn_type=subscr_payment two--
  8. oK... I think my error is here...it all look sgood to me... ------------------------------------------ $ch = curl_init(); //configure curl curl_setopt_array($ch, array ( CURLOPT_URL => 'https//www.paypal.com/cgi-bin/webscr', CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query(array('cmd' => '_notify-validate') + $_POST), CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false ) ); //perform curl request $response = curl_exec($ch); //get status of curl response $stat
  9. RE: ipn.php script..is the code in the book or the download have errors...? I noticed at least one discrepency between on line 8 book has if($status === 200 && $response =='VERIFIED') download has if ($status === 200 && $response === 'SUCCESS') just having trouble getting this script to work so I cannot really post a question. just wondering if there are any known errors as I have not found any posted in the forums Thank you
  10. I think I was asking question wrong..I want to create a unique id ie. $active =md5(uniqid(rand(), true)); as used to activate a user...I want each contact to have its own random id say anywhere from 10 plus characters long. Sorry for the confusion...I think my best bet is to create this in FM. I just was not sure if MySQLI had a way of creating it as opposed to creating with it with PHP and then inserting into MySQL....I am just not very familiar yet with MySQL. Thank you David
  11. Hey Thanks Larry for the tips.... After sleeping on this I thought about first creating a hash field in FM and then exporting to MySQL..I believe a hash can be created with some FM scripting...Thanks for you idea on exporting as CSV... Regards David
  12. I have a database(Using Filemaker) of contact info .ie name, email address ect...I want to import the data into a mysql table...my question... can mysl create a hash(and insert it into a column say called hash) to be associated with each contact?
  13. Hey thanks for the tips....It seems to be faster-may have been my data...if it slows again..I will try moving distance calc. to PHP side...also just made it a little more complicated as I added another query to find records within the found set of first query and not display the found records.....tried to used one large query for both..just not able to get it going....
  14. I am using a variation of the distance computation in Chp 3.... I do not have a large amount of data in the mySqli database... The query takes a very long time to run....I found it has to do with calculating the distance in the query...Was wondering if anyone else had this issue or has any thoughts...My query>>> $sr="SELECT l.load_id, CONVERT_TZ(l.date_posted,'UTC','$tz') AS date_posted, DATE_FORMAT(l.date_available, '%m/%d/%y') AS date_available , e.equipment_type,e.equipment_size,e.weight,e.hazmat,e.liquor,e.bonded, e.xtra_pickup,e.xtra_delivery,
  15. Yes ..I agree....the less info in the url the better....I like the POST way in the delete script..i think its script 10.4
  16. Yes thank you..I have a primary key....I using primary key in url....in a link.....ie.....edit_user.php?user_id=1..."1" being the primary key.......I am using scripts similiar to scripts 10.1 & 10.3..edit use.....I think what I was trying to remember was not to use the column name in the url..ie in this case do not use edit_user.php?user_id=1..use a generic name ie edit_user.php?genericname=1....read it somewhere not sure where...thank you for your help
  17. Thank for the quick response....I was trying to type short hand to keep the ? brief......What i meant was...should I create another column strictly for use in $_GET['query_id'] querys.... My concern is that the primary key would display in the url......Its just that for some reason and I may be wrong... I remeber reading something about this....Thank you
  18. Finished all scripts in book...participated in Boston PHP http://www.meetup.com/bostonphp/events/130131632/ ...great book and great self study....I think i rmeber reading about this but not sure...... when using $_GET['id'] in a mysql query...ie..WHERE user_id(primary key)= $_GET[id']...is this good practice?..or should I create another id in db specifically for a query..?
  19. wessmith4....Here is a thought from a newbie..I just used this,,,,,,. If you want to add a new random key to the attendees in place of your #34.....use php mt_rand() + current timestamp and grab x numbers......ie(-$attendee_id = substr(time().mt_rand(1,100000),6, 9);-).....then use the variable($attendee_id) in your INSERT query....or if you want to use id from household($_SESSION['household']).... try -$attendee_id=$_SESSION['household'];-then use the variable($attendee_id) in your INSERT query.....hope this helps
  20. One of my issues is..which page has the error... popup involves 3 pages...not sure which page - or section to post
  21. cannot figure this one out....ch 11 popup window(show_image.php)...I am getting the following error on the pop up window..."The Image...link to image location...cannot be displayed because it contains errors. Thank you
  22. Thanks much for the quick response..Although I was not able to make the above work ...you gave me an idea which did work....I used port forwarding on my router and used a different port for the new host machine(in XAMPP I changed the apache port to match the new port# in the router) and directed it to one machine running both MySql and XAMPP.... Many Thanks......
  23. Thank you for the quick response......All machines in one location networked together..like this internet from street->my router->switch-> desktops and server(running windows 2003)(hosting websites running IIS 6 and also running Filemaker Server).... I tried this:I opened a new port on router and used port forwarding and pointed to my desktop then on the web page "mysqli_connect.php" I tried to change the address to the url(as I have done with filemaker) and added the new port number.."DEFINE('DB_HOST', 'url:port#');"...........did not work....if i followed along in the book...i
×
×
  • Create New...