Jump to content
Larry Ullman's Book Forums

Ashley

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by Ashley

  1. Well, It has actually now been dispatched from Amazon. Can't wait this book is just what I have been looking for, Thank you for your reply Larry and Thank you for taking the time to write it.
  2. Without any hesitation I pre-ordered Effortless E-Commerce with PHP and MySQL 2nd Edition with Amazon as I know it will be a fantastic read. It has still not been released and there is no update on a revised release date on this book. Is it actually planned on being released for sale in The United Kingdom as at the moment it does not look promising ? Other book retailers do not appear to have any stock, will I have to get this book imported ?
  3. Sorry I did not answer your question HartleySan, I have checked and the CSS is not hiding anything. After checking with a friend I was told I had totally misused single (') and double (") quotation marks in the script which was creating further errors that the text editor did not pick up and I had set the variable outside of the function where it should have been inside of the function therefore the function was unable to access the variable Thank you helping me HartleySan and StephenM
  4. Later this week I am seeing some friends who have more coding experience than myself who might be able to solve it, I will keep you updated what happens either way, thank you for your help so far
  5. I think I am getting a little further, the p tags do display in the mark up. If i type $myvar = '<p>\'.$query_row[\'name\'].\'</p>'; echo($myvar) prints the code out as '.$query_row['name'].' (I was getting nothing before) and the markup displays as <p>'.$query_row['name'].'</p> when echo '<p>'.$query_row['name'].'</p>' is used the mark up correctly displays <p>Ashley</p> any further ideas ?
  6. This statement works fine as it is echo '<p>'.$query_row['name'].'</p>'; But how would it be possible to turn '<p>'.$query_row['name'].'</p>' into a variable that could be called back by a print or echo statement ? A not working example $myvar = '<p>'.$query_row['name'].'</p>'; echo $myvar; Does anyone know how this is possible?
  7. Thank you for your answers I have managed to get it to work using a form but can't get post method to work on fetch-array data
  8. On the view_users.php page, when you click on the "Edit" link you are redirected to another page using the user_id being passed to next page within the URL. On page 260 we are told of the first method in which uses the hidden input type for forms, how can we apply this method to the "Edit" link hyperlink and what adjustments would need to be made to the view_users.php script to allow this ?
  9. Can I ask a slighty related question (I'm not sure if I should really be making a new topic) I am looking to create a php page where the HTML and Jquery is printed or echoed in the page For example <?php print "All Jquery code"; ?> I have heard that you can break out of the php code like the following <?php My PHP Code ?> Jquery Code <?php More PHP code ?> But I would rather have the Jquery printed out in PHP and not breaking out of the PHP tags <?php ?> Any Ideas ?
  10. Thank you so much Larry, using the example you have given I should be able to recreate all the queries that I have listed above, I did not give January a thought that being the first month of the year would cause problems
  11. I have read though the date and time functions in the mysql pdf but still must be missing something I have been looking at http://forums.devshed.com/mysql-help-4/select-date-sub-of-today-yesterday-last-month-etc-531528.html where someone appears to be doing a similar project but appears to be going about the wrong way about it. For example If I wanted to display the fields relating to last month, this year I assume I would be connecting now(), month(), and Year() functions together. How would I do this ? does anyone know of a weblink showing examples like this and or would anyone be kind enough to write an example of how this could be written?
  12. Hello Nice People, I am looking to create some mysql queries to display the following I can correctly display today's registered users Select * FROM users WHERE date(registered) =date( curdate() ); and Yesterday's registered users Select * FROM users WHERE date(registered) =date( curdate() -1); but how do I do the following registered this week registered this month registered last month (not last 30 days) registered this year Thank you
  13. Thank you, Antonio Conte and HartleySan, I have successfully managed to get it working. Hopefully these posts should help other people who have encountered the same problem. Now I am going to try and see if I can get the edit edit_user.php working!
  14. I have been working with the code Antonio posted above but I must still be doing something wrong My first table 'users' has the fields user_id, username My Second table 'account' account_id, user_id, last_name, first_name, registration_date The line below works fine displaying data from users table, but fails to display 'account' table information $q = "SELECT last_name, first_name, username, DATE_FORMAT(registration_date, '%M %d, %Y') AS dr, user_id FROM users ORDER BY $order_by LIMIT $start, $display"; From Antonio's post, SELECT users.user_id, users.last_name AS lastname, users.first_name AS firstname, DATE_FORMAT(users.registration_date, '%M %d, %Y') AS user_date, messages.* FROM users as users INNER JOIN messages AS messages ON ( users.user_id = messages.user_id ) INNER JOIN forums as forums ON ( messages.forum_id = forums.forum_id ) To Mine $q="SELECT users.user_id, users.last_name AS lastname, users.first_name AS firstname, DATE_FORMAT(account.registration_date, '%M %d, %Y') AS registration_date, messages.* FROM users as users INNER JOIN account AS account ON ( users.user_id = account.user_id )ORDER BY $order_by LIMIT $start, $display"; If anyone is able to help further it would be much appreciated, I assume the same code I use in view_user.php for the query is the same code for edit_user.php
  15. Thank you, Antonio for your fast reply, I am going to try the way you have said and hopefully I should be able to make it work
  16. Just bought this book a few weeks ago and already it is proving to be fantastic, however I have already become stuck on something already In the "view_users.php" file, the following query is used for collecting the data from one table $q = "SELECT last_name, first_name, DATE_FORMAT(registration_date, '%M %d, %Y') AS dr, user_id FROM users ORDER BY $order_by LIMIT $start, $display"; If the information fields I wanted to recall was spread across two tables how would I need to adapt the code. I have seen the example on page 173 Select * From messages INNER JOIN forums ON messages.forum_id =forums.forum_id WHERE forums.name ='kindling' using the above structures I have managed to get a basic table to list users in php but as soon as I paste the code into "view_users.php", I am unable to display the table with the users listed Do I need to change something else from the file "view_users.php" to change it from reading the query as a single table to multi-table structure ? Thank you Ashley
×
×
  • Create New...