Jump to content
Larry Ullman's Book Forums

Placid

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Placid

  • Rank
    Newbie
  1. It may be the worst question in the forum, but I really need to ask. If WordPress can do so much so easily, why do we need to learn PHP frameworks, such as Laravel, that seem so hard. What can be built with these frameworks that is in demand. Please don't be annoyed with the naivety of the question. I would really appreciate some insights regarding this matter.
  2. Hey Hartley San, I'm sure you don't remember me. But you were my savior in the past... Thanks for your kind response. I have found the following to be a perfect solution: $('#'+thisid).html(response); Got the above from forum.jquery.com. Thanks again.
  3. I have an HTML table generated by PHP querying from MySQL table. <table> <tr> <th>Sl</th> <th>ID</th> <th>Article Name</th> <th>Publish Status</th> </tr> <?php $i = 1; foreach ($obj->showAllFromTable('pattern') as $pattern) { extract($pattern); ?> <tr> <td><?php echo $i++; ?></td> <td><?php echo $id; ?></td> <td><?php echo $pattern_name; ?></td> <td id="publish_<?php echo $id; ?>" class="status_pattern"> <?php echo $publish; ?> </td> </tr> <?php } ?> </table> I want to change the status of any article by clicking on the 'publish' cell of the corresponding article row. I am trying to use ajax method of jquery for this purpose as shown in the following: <script type="text/javascript"> $(document).ready(function(){ $('.status_pattern').click(function(){ var thisid = $(this).attr('id'); $.ajax({ url: "status_change_pattern.php", data: { id: thisid }, success: function (response) { alert(response); } }); }); }); </script> In the "success" block, instead of "alert", I want to create a functionality to change the text of the specific cell which I clicked. The "status_change_pattern.php" has just a text "Hey Hey". Can anyone help? Please. Thanks.
  4. Dear margaux, Thanks for your reply. Yes, the browse shows just as you suggested. I have even tried the SHOW COLUMNS command in mysql client, and it shows the same misleading value (NULL) under the default column. Whatever, I think I can go on with it though. Thanks again. Placid
  5. Again, 'SHOW * FROM users WHERE last_name IS NULL' command does not generate any result. Whereas, SHOW * FROM users WHERE last_name='' shows the expected record. FYKI Thanks Placid
  6. Dear Larry Sir, Since I am new and I don't want to give you any wrong picture, I want to go into details. I have deleted and recreated the 'users' table as follows: CREATE TABLE users ( user_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, first_name VARCHAR(20) NOT NULL, last_name VARCHAR(40) NOT NULL, email VARCHAR(60) NOT NULL, pass CHAR(40) NOT NULL, registration_date DATETIME NOT NULL, PRIMARY KEY (user_id)); In phpMyAdmin, the 'SHOW COLUMNS FROM users' command shows the following table: Field Type Null Key Default Extra user_id mediumint(8) unsigned NO PRI NULL auto_increment first_name varchar(20) NO NULL last_name varchar(40) NO NULL email varchar(60) NO NULL pass char(40) NO NULL registration_date datetime NO NULL Then, I tried to insert a new record without 'last_name' by the following code (as per second syntactical example on page 128 which says every column must be provided a value, even if it's NULL): INSERT INTO users VALUES (NULL, 'Placid', NULL, 'placid@example.com', SHA1('nothing'), NOW()) The phpMyAdmin shows: #1048 - Column 'last_name' cannot be null Then I tried the first method on Page 128 and inserted a record using the following code: INSERT INTO users (first_name, email, pass, registration_date) VALUES ('Placid', 'placid@example.com', SHA1('nothing'), NOW()); This time, the insert was successful. And the 'SELECT * FROM users' shows all the fields keeping the last_name field as blank. I hope I am clear. Finally, I thank you for your reply. I have grown huge respect for you reading your book. I am really learning. Thanks again. Placid
  7. Dear Masters, I am creating the first table columns in mysql client following the instructions in Ch 5 page 125. I have added the first_name and last_name columns with attribute "NOT NULL" but the "SHOW COLUMNS from users" shows the default values as "NULL". My codes are: CREATE TABLE users ( user_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, first_name VARCHAR(20) NOT NULL, last_name VARCHAR(40) NOT NULL); The book says that mysql will change the user_id column to NULL for better performance. It does not say anything about the other columns and the books result image show that only the user_id has default value of NULL and others have blank values under the Default column. Can any one please tell me what's the problem here. Much appreciate. Thanks Placid
  8. Dear HartleySan, The following messages come when I start XAMPP (though the examples in the first Chapter are working accurately). Can you please give me a hint if I need to do anything about these. 10:53:12 AM [main] Initializing Control Panel 10:53:12 AM [main] Windows Version: Windows 7 Ultimate 64-bit 10:53:12 AM [main] XAMPP Version: 1.8.0 10:53:12 AM [main] Control Panel Version: 3.0.12 [ Compiled: June 24th 2012 ] 10:53:12 AM [main] You are not running with administrator rights! This will work for 10:53:12 AM [main] most application stuff but whenever you do something with services 10:53:12 AM [main] there will be a security dialogue or things will break! So think 10:53:12 AM [main] about running this application with administrator rights! 10:53:12 AM [main] XAMPP Installation Directory: "c:\xampp\" 10:53:12 AM [main] Initializing Modules 10:53:12 AM [apache] Apache Service Detected With Wrong Path 10:53:12 AM [apache] Uninstall the service manually first 10:53:12 AM [apache] Possible problem detected! 10:53:12 AM [apache] Port 80 in use by "httpd.exe"! 10:53:12 AM [apache] Possible problem detected! 10:53:12 AM [apache] Port 443 in use by "httpd.exe"! 10:53:12 AM [mysql] MySQL Service Detected With Wrong Path 10:53:12 AM [mysql] Uninstall the service manually first 10:53:12 AM [mysql] Possible problem detected! 10:53:12 AM [mysql] Port 3306 in use by "mysqld.exe"! 10:53:12 AM [main] Starting Check-Timer 10:53:12 AM [main] Control Panel Ready I appreciate your response. Thanks Placid
  9. Dear HartleySan, Please accept my respect and gratitude for your response and also my apology for this dumb mistake. I looked here and there and specially read the whole Appendix of the book once again, but did not see that spelling error. Corrected the spelling and it worked. Thank you again. Placid
  10. Dear Masters: I am very new to to PHP & MySQL. I have just followed the instruction in the book to install XAMPP (v 3.0.12) on my Windows 7 PC. I tested PHP as per the instruction and it was successful. But testing PHP and MySQL failed and showed the following error: Fatal error: Call to undefined function msqli_connect() in C:\xampp\htdocs\mysqli_test.php on line 2 I am almost sure I followed the instructions exactly. But the above error comes. I looked for solutions in other posts but could not find it. Anyone, please help. Thank you. Placid
  11. It worked !! Thank you so much. The part of your solution that I needed was: "multiple that random number by the length of the tasks array". Thank you again. I really appreciate.
  12. Dear Masters: I am new to JS, learning it first from this book. Completed sequentially upto Ch 6. Now I am stuck at Chapter 6, Pursue Problem No. 3 - "Update the original tasks.js so that the output also shows a random task." I have tried many ways but unable to generate a purely random task. Can any one help, please. I am using: Browser: Firefox 13.01 OS: Windows 7 IDE: Aptana Studio 3 P.S. My gratitudes to Sir Ullman for this awesome book. I have tried many but started to really learn from here. Thank you. Placid
×
×
  • Create New...