Jump to content
Larry Ullman's Book Forums

banacan

Members
  • Content Count

    48
  • Joined

  • Last visited

Community Reputation

2 Neutral

About banacan

  • Rank
    Member
  1. Hi Larry, Thanks for replying. For some reason I did not get notified about your response which is why I'm just now seeing your post. I was hoping the Matthaus might chime in since he helped me once before with linux command line. Does anyone know how to reach him?
  2. I have my db backed up and emailed to me (the size of my db is small so email is not problem) using the following mysqldump command in a cron running weekly and it is working perfectly. mysqldump -e --user=username --password=password database | gzip | uuencode database_name.gz | mail me@domain.com All I want to do is add the current date of the backup to the gzip filename so each backup filename is unique. I have searched for the answer and found this suggestion: mysqldump -e --user=username --password=password database | gzip | uuencode $(date +%Y-%m-%d)-database_name.gz | mail me@domai
  3. Resolved I recreated both the connection script and DB query and now it is working fine on both the dev server and live server. I must confess, I don't see the difference between the original version and the new version, but who cares as long as it works.
  4. Sorry for the BUMP, but can anyone offer a suggestion as to why this works on my dev. server but not my live server? I have looked at the email output of my_error_handler, and I see the two different connection variables each of which has been assigned a Resource id. I also see the username and password for each connection which are both correct. The error I'm receiving is: mysql_num_rows(): supplied argument is not a valid MySQL result resource and the error is pointing to line 33 which is this: $totalrecords = mysql_num_rows($result); which indicates that the query is not producing a
  5. I'm using the scripts in chapter 16 to register users on a site. Because I was concerned about granting privileges to Select, Insert, and Update on the entire DB, I created a separate DB just for "external users". Everything works just great, except now I want to access this external user DB in the Admin site which uses a different DB (the general site content DB). I tried adding two connection scripts in my admin.php file, and while it works fine on my MAMP Pro server, I'm getting errors on my production server. My connection scripts setup different connection variables, so there should b
  6. Thanks. I only needed one solution and this was the first one that worked.
  7. Thanks HartleySan, that makes it clearer to me. So basically this creates an array of just the information I need for each row of the DB table. Couldn't $item have been constructed with $row['div_name'] and $row['grp_name'] at the same time the rest of the array was created? In other words: $item = array('div_name'=>$row['div_name'],'grp_name'=>$row['grp_name'],'title'=>$row['title'],'descr'=>$row['descr'],'price'=>$row['price'],'price2'=>$row['price2'],'price3'=>$row['price3']); Or is there something different about the line in question?
  8. My issue is solved, though I sure hope someone can explain it to me. Someone on another forum gave me the solution, but I couldn't get him to explain it. Here's the code: $listMenu = mysql_query($query_listMenu, $siteuser); while ( $row = mysql_fetch_array($listMenu, MYSQL_ASSOC) ) { $item = array('title'=>$row['title'],'descr'=>$row['descr'],'price'=>$row['price'],'price2'=>$row['price2'],'price3'=>$row['price3']); $menuRows[$row['div_name']][$row['grp_name']][] = $item; } ?> <div id="menu_list"> <?php foreach($menuRows as $divname=>$grp){ // echo
  9. Hi Antonio, Thanks for replying. The Menu table is quite simple: Column Type Null Default menu_id int(10) No div_id int(10) No grp_id int(10) Yes NULL cat_id int(10) Yes NULL date_b date No date_e date No price float(6,2) Yes NULL price2 float(6,2) Yes NULL price3 float(6,2) Yes NULL title varchar(255) No descr text Yes NULL special enum('n', 'y') No n ordr int(4) No 10 My query: $query_listMenu = sprintf("SELECT menu.menu_id, menu.div_id, m_div.div_name, menu.grp_id, m_grp.g
  10. I have a query that returns all items in the DB table, including price(s), description, title, and menu section (lunch, dinner, beverages, etc.), ordered by menu section, menu item, title. The query results are dumped into a multidimensional array and displayed on the page. Now I want to put each menu section in a separate accordian window, so how do I iterate through the array and separate out items by menu section? This is made more difficult because I don't know what menu sections might be added later. Is a recursive function what I need instead of an iterative?
  11. HartleySan, No, I did not take your reply as snippy or sarcastic. You and Antonio are way more advanced in your programming skills and understanding than I am, and I like to take advantage of that knowledge whenever possible. As Antonio said in one post, he may not have the solution, but he can help my thought process. By you mentioning the iterative vs recursive, it got me thinking, and that led me to a search, which resulted in finding a very helpful article, that ended in better understanding. All of this was very important and helpful, which is why I'm so grateful to you and Antoni
  12. HartleySan, It seems we were both posting about the same time. Yes, after reading the article, I realized the significance. BTW, I wasn't being flip, I just wasn't clear on the subtleties. I now have a much better understanding. Thanks for your input.
  13. Thanks to both of you for your comments. I did a search for "iterative vs recursive" and found a wonderful explanation of the two, and when which is appropriate. Without going into too much depth - that is done beautifully in the article - the main take-away for me was at the end of the article when the author stated: So when I look at what I'm trying to do (I started two separate posts addressing different parts of the same problem), I need to use both recursive and iterative functions. I need the recursive to traverse the tree to whatever depth is there, keeping track of the hier
  14. HartleySan, Is this a distinction without a difference? Thanks for taking the time to reply.
×
×
  • Create New...