Jump to content
Larry Ullman's Book Forums

abigail

Members
  • Posts

    184
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by abigail

  1. Did you try doing that query without selecting first_name? And did you try the query in MyphpAdmin? If neither of those reveals any new information, you could try changing the name of the table. Leave old table there and make a new one. Than new one should work then.
  2. Here is .csv file, excel always changes it into type date (not text): 1/1/2014 1 2 3 4 5 6 1/2/2014 7 1 2 3 4 5 1/3/2014 7 1 2 3 4 5 1/4/2014 8 9 1 2 3 4 1/5/2014 8 9 1 2 3 4 Here is the query ($dd is the date): $q = "INSERT INTO I_FL_Draws (draw_date, morning_1, morning_2, morning_3, evening_1, evening_2, evening_3) VALUES ($dd, $mb1, $mb2, $mb3, $eb1, $eb2, $eb3)";$r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc));if ( (!mysqli_error ($dbc)) && (1 == mysqli_affected_rows($dbc)) ) { // If it inserted OK. $mycount++;} else { echo "<p class=\"error\">Could not insert one.</p>"; $sqlfailure = 1;} // did not insert ok And here is how I read $dd from .csv file: // open uploaded infile for read$fd = fopen ($realfile, "rb") or exit ("Unable to open file!");$mycount = 0;while(!feof($fd) ) { // Read one line from infile $oneline = fgetcsv($fd, 1024); if (isset($oneline[0])) $dd = $oneline[0]; But here is the oddest thing that I can't figure out. I debugged this. I changed the draw_date column to be not unique and allow null and I used NOW() for the date and it worked. So I then changed that to use $dd and it worked. Then I worked with another similar routine, which didn't work, I came back to this one and now it doesn't work. It inserts NOW() but $dd becomes 0000-00-00.
  3. How do get .csv date into MySql date. .csv always changes my text cell into a date cell, which MySql turns into "0000-00-00"
  4. Because your header file already opens the database, can you get the subject there? That would actually be easier even. You will catch on when it works, that's probably why he challenges you to do this. When you see it working, where it's called from, and experiment a little it will all make sense.
  5. I'm implementing a MySql transaction. Do I have to issue this autocommit first? mysqli_autocommit($dbc, FALSE); And if I do that I need to set it true after the transaction? There are not any other database queries on that page after the transaction.
  6. If I understand correctly, which I might not because I don't have that book, you have the subject and other information in the database. What you need to do is get any of the Page Title and others that Header uses, you have to get it from the database before you include the header. So first include the config file, then open and retrieve from the database, then call the header. You could make it global but I think that would really be overkill and not likely what Larry was looking for in this example. But if there is no other way then that would be a solution.
  7. I believe the $dbc is valid because I Select from a different table successfully. There are these additional errors but I didn't think you need them all. Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, null given in /home/advice10/public_html/astuff/enter-morning.php on line 93 A system error occurred. We apologize for the inconvenience. Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, null given in /home/advice10/public_html/astuff/enter-morning.php on line 94 A system error occurred. We apologize for the inconvenience. Warning: mysqli_error() expects parameter 1 to be mysqli, null given in /home/advice10/public_html/astuff/enter-morning.php on line 94 A system error occurred. We apologize for the inconvenience. Maybe I have to do it not prepared, but I forgot the syntax.
  8. When I run this query from PhpMyAdmin it works but when it's a prepared statement it doesn't work. The problem is with the date and the column type is date because I want only one row for each date in this table. $q = "INSERT INTO I_Counts (count_date, morning_1, morning_2, morning_3) VALUES (NOW(), ?, ?, ?)"; $stmt = mysqli_prepare($dbc, $q); mysqli_stmt_bind_param($stmt, 'iii', $mb1, $mb2, $mb3); Warning: mysqli_prepare() expects parameter 1 to be mysqli, null given in /home/advice10/public_html/astuff/enter-morning.php on line 92 A system error occurred. We apologize for the inconvenience. Notice: Query: INSERT INTO I_Counts (count_date, morning_1, morning_2, morning_3) VALUES (NOW(), ?, ?, ?) MySQL Error: in /home/advice10/public_html/astuff/enter-morning.php on line 94
  9. I didn't take the time to look at your previous. code. I think what you need to do is in each page, set variable: $subtitle = "here is subtitle for page one" Place this before you include your header file. Then header file echos $subtitle,
  10. Well, that's embarrassing. You are right and I even feel I have wasted your valuable time. And the reason is cpanel didn't do the redirect and tech support was fixing it so that's why I had it commented out. Thank you so much.
  11. My htaccess file works except the Redirects. They used to work. sickle cell anemia is the one I added yesterday and it doesn't work. back pain and heartburn used to work but now they don't. sleep disorders and hemophilia are also in my cpanel Redirect and they work from there and are not really needed here. But I don't want to do it through cpanel and I shouldn't have to. Can you find what is wrong with my code? Here is my entire htaccess file: ErrorDocument 404 /404.shtml ErrorDocument 400 /400.shtml ErrorDocument 401 /401.shtml ErrorDocument 403 /403.shtml ErrorDocument 500 /500.shtml # this is to handle the 301s because I moved my files or renamed them <IfModule mod_rewrite.c> RewriteEngine On # # Following is because linkback from: #ningxiebayinzi.com/unique-hemophilia-treatment-fixes-your-illness-prevents-hemophilia Redirect 301 /hemophilia-treatment /unique/hemophilia-treatment # # Following is because linkback from: #solutionssnoring.org/brussels-griffon-snoring/ #solutionssnoring.org/ayurvedic-treatment-for-sleep-disorder/ #solutionssnoring.org/category/1/page/3/ Redirect 301 /sleep-disorders-treatment.php /unique/sleep-disorders-treatment # # Following is renaming by canonical when in home so .php needs to be specified #Redirect 301 /sickle-cell-anemia-treatment /sickle-cell-anemia-treatment.php #Redirect 301 /back-pain-treatment /back-pain-treatment.php #Redirect 301 /hiccups-heartburn-treatment /hiccups-heartburn-treatment.php </IfModule>
  12. Yes, you will not become a better programmer using any of the blog hosts. Maybe you would learn a LITTLE html but that is it. The reason people are so excited about feature or plug-in at WP is they don't want to program (like I don't want to program my blog) so if they need everything provided for them or do without it. I'm certainly not trying to talk you into not programming it yourself. I also have always preferred to program it myself but for me, I already have my website for that and no more time to take on yet another project. And for me, getting my blog up fast and easy is number one priority and weebly has done that for me. So if Better Programmer is your objective then your plan will do it. I would suggest consider Social Media Icons (which you probably know already) and also will you write versions for desktop and mobile.
  13. I'm just starting a blog and my first step was to find out where I want that blog and get a few posts onto it. (Start small like Antonio and HarleySan advised) I tried blogger but I don't like the interface, etc. I tried WordPress and I don't like it at all. Someone suggested weebly.com, I tried it and I love it. But which blog host you pick really is very personal, depending what type of interface you like and many other things. So early on, find out where you want to be. I had 5 posts up and I am now almost finished moving everything over. Up until now, I wanted to code everything myself. But I put most of my time into my website and how much time does someone have to add on top of that a blog, facebook, twitter, and on and on? So for me, I wanted to find a blog host that would do all that for me, as many people do. Probably WordPress doesn't let you do what you want or it is too cumbersome. Or it might be you have time to code it yourself and your blog might be your main project. (unlike my website) Also probably you can do better SEO if you code it yourself.
  14. You are right HartleySan. I added the amp; after the & and it now validates! This will not change my links in anyway? Because that is how my affilliate id is known by the company website.
  15. That was a good idea, Larry, that I would not have thought of. I ran the html5 test here http://adviceofthequeen.com/testhtml5.php It reduced the errors to 10. But HTML5 will require significant changes to my layout and would only be worth it if it got rid of all the errors. Here are the errors now: W3C Markup Validation Service Check the markup (HTML, XHTML, …) of Web documents Errors found while checking this document as HTML5! Result: 10 Errors, 1 warning(s) Validation Output: 10 Errors Error Line 87, Column 128: & did not start a character reference. (& probably should have been escaped as &.) …com/index.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_id… Error Line 87, Column 135: & did not start a character reference. (& probably should have been escaped as &.) …ex.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_… Error Line 87, Column 151: & did not start a character reference. (& probably should have been escaped as &.) …=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_id=55"></script> Error Line 87, Column 157: & did not start a character reference. (& probably should have been escaped as &.) …=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_id=55"></script> Error Line 87, Column 170: & did not start a character reference. (& probably should have been escaped as &.) …=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_id=55"></script> Error Line 111, Column 128: & did not start a character reference. (& probably should have been escaped as &.) …com/index.php?dispatch=aff_banner.view&bid=28&type=js_content&sl=EN&product_id… Error Line 111, Column 135: & did not start a character reference. (& probably should have been escaped as &.) …ex.php?dispatch=aff_banner.view&bid=28&type=js_content&sl=EN&product_ids=&aff_… Error Line 111, Column 151: & did not start a character reference. (& probably should have been escaped as &.) …=aff_banner.view&bid=28&type=js_content&sl=EN&product_ids=&aff_id=55"></script> Error Line 111, Column 157: & did not start a character reference. (& probably should have been escaped as &.) …=aff_banner.view&bid=28&type=js_content&sl=EN&product_ids=&aff_id=55"></script> Error Line 111, Column 170: & did not start a character reference. (& probably should have been escaped as &.) …=aff_banner.view&bid=28&type=js_content&sl=EN&product_ids=&aff_id=55"></script> I also ran a test for XHTML but that gave all the original errors.
  16. I have affiliate links that are causing a lot of HTML validation errors. I do not understand Javascript very well. Is there any way I can fix these myself. The company has stopped making updates for me. You will notice that the banners show the links and therefore look terrible. If I change the ShowURL form Y to N then the link does not click through. This is just cosmetic, though. I've setup a test page so you can see the banners/links and you can validate that page to see all the errors. http://adviceofthequeen.com/test.php Here is the first banner on that page: <p class="centered"><abbr title="Manual Do It Yoursef-see home page for details.">MDIY</abbr> free</p> <div class="centered-banner"> <script type="text/javascript" src="http://www.the-tree-of-life.com/lib/jquery/jquery.js"></script> <script type="text/javascript" src="http://www.the-tree-of-life.com/js/core.js"></script> <script type="text/javascript"> //<![CDATA[ if (typeof(cart_banner) == "undefined") var cart_banner = new Array(); cart_banner[25] = { BoxWidth: '236', BoxHeight: '16', OutlineColor: '#296DC1', TitleTextColor: '#FDFDFD', TextColor: '#333333', TextBackgroundColor: '#F9F9FF', ShowURL: 'Y' /* Y - yes; N - no*/ } //]]> </script> <script id="id_script_banner_25" type="text/javascript" src="http://www.the-tree-of-life.com/index.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_id=55"></script> </div> And this is the second banner: <div class="centered-banner"> <script type="text/javascript" src="http://www.the-tree-of-life.com/lib/jquery/jquery.js"></script> <script type="text/javascript" src="http://www.the-tree-of-life.com/js/core.js"></script> <script type="text/javascript"> //<![CDATA[ if (typeof(cart_banner) == "undefined") var cart_banner = new Array(); cart_banner[28] = { BoxWidth: '236', BoxHeight: '16', OutlineColor: '#296DC1', TitleTextColor: '#FDFDFD', TextColor: '#333333', TextBackgroundColor: '#F9F9FF', ShowURL: 'Y' /* Y - yes; N - no*/ } //]]> </script> <script id="id_script_banner_28" type="text/javascript" src="http://www.the-tree-of-life.com/index.php?dispatch=aff_banner.view&bid=28&type=js_content&sl=EN&product_ids=&aff_id=55"></script> </div> This is some of the errors which I have edited to reduce length: W3C Markup Validation Service Errors found while checking this document as XHTML 1.0 Transitional! Result: 15 Errors, 25 warning(s) Validation Output: 15 Errors Warning Line 88, Column 129: cannot generate system identifier for general entity "bid" …om/index.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids… Error Line 88, Column 129: general entity "bid" not defined and no default entity …om/index.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids… Warning Line 88, Column 132: reference not terminated by REFC delimiter …index.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&a… Warning Line 88, Column 132: reference to external entity in attribute value …index.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&a… Warning Line 88, Column 136: cannot generate system identifier for general entity "type" …x.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_i… Error Line 88, Column 136: general entity "type" not defined and no default entity …x.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_i… Info Line 88, Column 135: entity was defined here …ex.php?dispatch=aff_banner.view&bid=25&type=js_content&sl=EN&product_ids=&aff_…
  17. indes.php vs index.php? otherwise it would probably be the ....../ I don't know about using 6 dots like that.
  18. Makes sense to me, to stay consistent with Amazon. I'm so glad I don't have to use PayPal.
  19. saniko, just a suggestion, did you look into Stripe? Maybe there is good reason you like Amazon Checkout better, though. Larry, your new edition enhancements look great.
  20. Put everything that access your database under SSL. So SSL-secure pages are entirely separate from non-secure pages. To pass between them, pass your Product Id or something harmless like that.
  21. I use a cookie when I have mobile version of my site, so they can click 'mobile' link if my code didn't pick it automatically. I save it in a cookie so when they move page-to-page the code already knows if mobile or fullsite. I use a session only for secure pages that access the database.
  22. I think that if someone has your name they can find you. The only exception would be those with a very common name such as Jane Smith. Then tracking down the one Jane Smith among the hundreds would be easier because you know their location. Even if your name is not common, it only makes it a little easier to know their location. That is why it is my opinion that a female should not use her real name online. Males are at risk too but more females get stalked. There doesn't seem to be much value in storing the IPs. For my website, I keep the IP and username in an Errors table, but I don't keep the IP in the Users table. I check for either IP or username with 10 errors today then they are locked out until tomorrow (unless they contact me to reset it). Even though the savvy can change the IP I will catch any that don't. One thing that you should do to keep from getting stalked is not to argue with people. After you are in an argument for awhile, you will drop it, but the stalker will never drop it. I don't mean avoid debates about programming, web design, etc. You might like to take a look at this book: Net crimes & misdemeanors : outmaneuvering web spammers, stalkers, and con artists / by J.A. Hitchcock, or similar.
×
×
  • Create New...