SitePoint Sponsor

User Tag List

Page 2 of 5 FirstFirst 12345 LastLast
Results 26 to 50 of 119
  1. #26
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    NUMERIC and DECIMAL are indeed two names for the same column type in MySQL. The key purpose of this column type is to allow you to specify the exact number of digits before and after the decimal point, and to be assured of exact precision of the values you store (as opposed to floating point numbers, which suffer from limited precision).

    At least in current MySQL versions, there are no practical limitations on the use of NUMERIC/DECIMAL values in mathematical operations.

    Full documentation on these data types is provided in chapter 11 of the MySQL manual.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  2. #27
    SitePoint Member
    Join Date
    Jun 2005
    Location
    Portland, Oregon, USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for that link Kevin, that clarifies a lot - I hadn't quite understood the difference between storage range and display width, but it makes perfect sense now. Also, it appears that "decimal" does differ in that it's STORED as characters rather than binary, but it doesn't say anything about that affecting how you can manipulate it. Looks like I misunderstood that too. I'll have to explore that manual in more depth!

    On a different note, I've been unsuccessful at getting a PHP script to connect to a MySQL database. I typed in the example on page 76 of your book (2nd ed) and it's not displaying anything. (By the way the file in the code archive seems incomplete, unless my download somehow got corrupted.) By putting "echo" statements in at various points in the code and observing whether or not the text is displayed, I narrowed it down to the line where it tries to connect:

    $dbcnx = @mysql_connect('localhost', 'root', 'mypassword');

    If I load up the page in a web browser, nothing after that line shows up...not even the HTML that's outside of the PHP tag ("Here are all the jokes in our database.") It just seems to stop.

    From the linux command line, the syntax of 'msql -h localhost -u root -p'
    followed by my password works fine.

    Any idea where else I can look? I've tried some of the things suggested elsewhere in the forums (for instance removing the root password, and fooling with single-, double, and no quotes), but so far no luck!

    -Pete

  3. #28
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It sounds like the MySQL support in your PHP installation isn't working. Remove the error suppression operator (@) from that line and see what error message PHP displays. If it complains that the function mysql_connect doesn't exist, you'll need to reconfigure/recompile PHP with MySQL support enabled.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  4. #29
    SitePoint Member
    Join Date
    Jun 2005
    Location
    Portland, Oregon, USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes...

    Fatal error: Call to undefined function: mysql_connect() in /var/www/apache2-default/nddpage.php on line 10

    So...will the apt-get installation not work for me? Do I need to go back to the compile-from-source approach?

    In another forum config_doug suggestes turning REGISTER_GLOBALS on, but said that might present a security risk. Seemed easy enough to test so I tried it, and then did 'apache2ctl graceful' but it made no difference.

  5. #30
    SitePoint Member
    Join Date
    Jun 2005
    Location
    Portland, Oregon, USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe a step closer??

    I found a web site
    http://www.projektfarm.com/en/support/debian_setup/
    with instructions for setting up all this stuff on Debian. For one thing, it said to install a bunch of PHP-related packages I didn't have installed. So I did that (all but a couple that I couldn't find.) But, these instructions were for Apache 1.3, and I have Apache 2. I followed the instructions as best I could, making some guesses along the way.

    Now, I get a different error message when trying to load my page:
    Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /var/www/apache2-default/nddpage.php on line 10

    On inspection, the file mentioned in the error code (/var/run/mysqld/mysqld.sock) indeed does not exist on my system.

    Seems like progress...but I'm not sure what the next step is!

  6. #31
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yep, you've got MySQL support added to PHP, which is good. Now if you're sure MySQL is running, it sounds like MySQL is set up to accept TCP/IP connections only, not local socket connections.

    I'm afraid I don't know how to solve that one offhand -- worth a trawl through the relevant mailing lists. If you strike out, try installing MySQL manually rather than via apt.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  7. #32
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error when restarting IIS

    This is an awesome book. It's exactly what I needed.

    The problem I'm having is that when I restart the World Wide Web Publishing Service as described on page 9 of the book, I get the error message:

    PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysql.dll'

    I'm absolutely sure that this file is in the correct place, but it still gives me that. The today.php file later crashes the window spouting some memory access violation and show the text on the screen in numbers. Any advice?
    Last edited by davidleehemphill; Jun 16, 2005 at 15:22.

  8. #33
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kevin Yank
    I'm afraid I don't know how to solve that one offhand
    You're a disgrace

  9. #34
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by davidleehemphill
    The problem I'm having is that when I restart the World Wide Web Publishing Service as described on page 9 of the book, I get the error message:

    PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysql.dll'
    Can you confirm you have copied the file libmysql.dll to your \WINDOWS\SYSTEM32 folder?
    The today.php file later crashes the window spouting some memory access violation and show the text on the screen in numbers. Any advice?
    You're talking about a Windows Blue Screen of Death (BSOD), right? Sounds like a driver or hardware problem unrelated to (but simply being triggered by) PHP and MySQL. If the problem's repeatable, I'd consider a Windows reinstall.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  10. #35
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I can confirm that I have copied the file. And no, it's just an alert box crash with some inetinfo.exe application error. I have uninstalled IIS and reinstalled again using the exact processes you described, but it displays this in the browser instead of "Today's Date (according to this Web server) is":


    -2147467259 (0x80004005)

    Does that help anymore? Thanks for your assistance.

  11. #36
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    These chapters are very helpful. So far so good. I have a muddled installation in that there seem to be vestiges of an earlier installation, and have ended up installing 4.1.12 as MySQL41 under Windows services. The command line operations seem to be working properly, so far, having got part way through the joke database.

  12. #37
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you provide any info about the configuration wizard you have to go through?

  13. #38
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I, too, am having problems with the examples. I ran the simple examples early in the book (to make sure PHP is working), PHP is working fine. But for some reason I cannot connect to the MySQL database.

    I am running WinXP SP2, and all the latest Apache, MySQL, and PHP software. I posted a thread about this here:

    http://www.sitepoint.com/forums/showthread.php?t=286312

    Is it possible that the code in the example tutorials are not compatible with the latest versions of MySQL or PHP? As sneakypete mentioned above, none of the HTML code after the PHP code prints out. It's almost as if the code halts mid processing. Also, I removed the "@" symbols before the functions and the errors don't even print out.

    Any ideas at all?

  14. #39
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    mithtered, I've responded to your thread.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  15. #40
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just tried out Example 1.1 and it works just fine. Running Win XP. Tried uploading the same page on my (under construction) website - host:Tripod.com and the php line does come up as invalid code... No idea wonder why yet. Will try to find out.

    Thank you for posting this information.

    Very Happy ^_^ :- Cass

  16. #41
    SitePoint Evangelist chiphunt1's Avatar
    Join Date
    Oct 2003
    Location
    louisville, ky
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just out of curiosity, is PHP available on tripod? I would hope so, but you never know. No reason why it shouldn't work. What is the name of the file you uploaded to the server and what is the error you get? I'm trying to use telepathy, but it's not working.

  17. #42
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just tried out Example 1.1 today. No problems. Running Win Xp & Apache Server 2.0.54.

    The php was disregarded when upload to my (under construction) website at Tripod.com. Haven't found out why yet.

    Your instructions were easy to follow.

    Thanks very much. Off to continue reading.

    ^-^ : Cass

  18. #43
    vicki
    SitePoint Community Guest
    I am following the tutorial that walks you throught the steps of how to install mysql and php. I have installed both and I am now at the step of :

    To set a root password for MySQL, open a command prompt (or Terminal window) and type the following command in the bin directory of your MySQL installation:

    mysql -u root mysql

    Once I enter this into the terminal window, it says that there is no such command. I am running OSX 10.4. I have made sure that mysql server is running. Can you tell me what my problem is?

  19. #44
    SitePoint Wizard mPeror's Avatar
    Join Date
    Mar 2005
    Location
    Saudi Arabia
    Posts
    1,724
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By Kevin Yank
    October 5th 2004
    Reader Rating: 9.2
    Seems like this thing needs to be fixed..

  20. #45
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am interested in this book and thought I would follow the first part that was free and if all works well, I get the book. I am new to all this and have had problems getting MySQL access. Pasted below, from mac installation,


    To set a root password for MySQL, open a "command prompt (or Terminal window) and type the following command in the bin directory of your MySQL installation:

    mysql -u root mysql"

    I just get command not found when I add "mysql -u root mysql", so I did not get very far. using mac, and terminal. Thanks for any feedback

  21. #46
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Cant install Apache

    I've got the book too, but am having problems in installing Apache. I have Windows ME but when I try the installation files I get "Internal Error 2735. ResolveServerName.

    I was trying to set it all up on a local machine for testing/learning purposes etc.

    Has anyone come accross this before?

  22. #47
    SitePoint Member sardoman's Avatar
    Join Date
    Feb 2006
    Location
    Sardinia, Italy
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got the 3rd Edition. I've worked through the installation chapter only to fail at the First PHP Script test: viewing the source code I see the <?php ... ?> line.
    I've gone back and double checked all the settings as explained in the book. I've restarted everything and still no joy. I'm running Windows XP Pro with IIS. Any ideas what I should do now?


    PS: forgot to mention I've loaded MySQL 5.0.17 and PHP 5.1.1

  23. #48
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    sardoman,

    How are you loading the script in your browser? Make sure you're typing the http://localhost/... URL into the address bar, and not opening the file in your browser with File > Open.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  24. #49
    SitePoint Member sardoman's Avatar
    Join Date
    Feb 2006
    Location
    Sardinia, Italy
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kevin Yank
    Make sure you're typing the http://localhost/... URL into the address bar, and not opening the file in your browser with File > Open.
    By typing http://localhost/today.php I got an error message: "Invalid access to memory location." When I type the path to the file I have the problem in that where the date should be it is blank. I loaded the file onto my web server and it worked ok so I know it isn't a syntax error.

    Uninstall and try again? Thanks for the help

  25. #50
    SitePoint Enthusiast php junky's Avatar
    Join Date
    Nov 2006
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    welcome1 gives zip file

    I'm waiting on my book to arrive in the mean time I'm using the e-book down load.I got to the part of making welcome1.html and welcome 1.php but when i click on the link in welcome1.html it presents a pop up to down load a zip file (which is wrong I know).when i click to open the zip file,it opens the text of the welcome.php file and not the browser page. does anyone know whats happening here.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •