Jump to content

kigroy

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by kigroy

  1. how do i limit the number of decimal places displayed when performing math functions in php?
  2. thank you thank you thank you thank you thank you!!!
  3. I'm running WAMPSERVER 2.0 MySQL 5.1.30 and PHP 5.2.7. In my database, db, I have a table, tb, with a column, cl. In cl I have 5 cells that contain the word test. I made my query in phpMyAdmin and it finds the 5 cells that contain the word test in cl of tb, but when I run it in my php code my variable assigned to the query array returns on the instance of the word test. Thoughts? $query = "SELECT cl FROM tb WHERE (`cl` LIKE '%$name%')"; /* $name set from form that I know works*/ $result = mysql_query($query, $conn); $row=mysql_fetch_array($result) print_r($row);
  4. What do call the exclamation point in the following code: if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } I don't know what it's called so I can't look it up at php.net. ??? Thanks...
  5. Thanks! Worked like a charm. BTW, I'm a noob if you haven't figured it out.
  6. I get the resource ID #3 error when I run this code: In my header tags: <?php $conn = mysql_connect('dbname','username','password') or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('tablename',$conn) or trigger_error("SQL", E_USER_ERROR); $name = mysql_real_escape_string($_GET['name']); //**from form submitted. the form code works i doubled checked**// $query = "SELECT column_name1 FROM column_name2 WHERE column_name2 = '$name'"; //** query works too, i tested in phpMyAdmin**// $result = mysql_query($query, $conn); ?> In my body tags: <?PHP echo $result ?> My server is WAMPSERVER 2.0 and my php running is 5.2.7. Thoughts? Thanks
  7. Thanks for the explanation. I will aspire to that format.
  8. Question about coding practice: Is it better to separate your php code from your html unless you need the php code to generate a variable amount of html code (i.e. using a loop command to create rows or columns on a table)? or to have the entire page created by php? The reason I ask is I was trying to code with php creating all the html code when I was discussing something with a programmer and he said to NEVER do that. That it only creates confusion and only should be done when you are dealing with a variable amount of columns or rows in a table. Thoughts? BTW, I was using php to create all code based off some examples I found here at phpfreak.com.
  9. got it fixed. I had to look at files via http://localhost/index.php not opening them with Firefox. Thanks!
  10. I am running WAMPserver 2e on a windows XP SP 2 machine. When I open the index.php file in the www C:\wamp\www folder a bunch of gibberish and if I run a simple php script I dont see anything either. Any suggestions? This is a fresh install. I have made no modifications. Thanks!
  11. ok, i'm going to go and play around with it for a while and see what I come up with. Thanks...
  12. Ok I'm confused. What I would like to do: Create a database and supporting tables in Navicat (similar to phpMyAdmin) on my local server (XAMPP). And I want to write php scripts and html documents and save them on my local server so I can not only test them, but use them to add information to my tables in my database that is also on my local server, and then when I'm satisifed with the look, feel and usability of my site that I've developed locally, I want to upload the entire site to my remote server, databases and all. I do know how to import databases into my remote server, and I know how to ftp files to my remote server, but when creating the databases and php and html files locally, do I store the files in: for php and html docs: C:\xampp\htdocs\ (the localhost folder) and for the database: C:\xampp\mysql\data (where phpMyAdmin woud go to create and manage mysql databases)? and if I do store the files and databases in their respective folders, and upload them later to my remote server will I have any issues? Thanks!
  13. Ok, so will the php scripts query the MySQL database on my local server just like they will on my website server using the paradigm described?
  14. So if I write a script in php and save it in C:\xampp\htdocs\ (the localhost folder), and it queries database_X, which is saved in C:\xampp\mysql\data folder (default MySQL folder), and then later upload everything into their respective locations on to my webhost server all the links and filepaths will work?
  15. I started getting the alerts bc I changed the username and password, and in order to change the username and password I did the following: For every alert that popped up, in the lower right hand corner of the screen in the toolbar a traffic signal icon popped up. Right click on the icon, and click "show me." Click on the my.ini tab. Change the username to root and leave the password blank. I have no more problems.
  16. I'm a bunch of WinMySQLAdmin 1.4 errors. I clicked on the Admin button next to MySQL in the control panel and it asked for a username and password and i thought it was asking to create one. I entered one in and now I receive the error: Access violoation at address ... What is going on and how do i stop it?
  17. Using Navicat I want to create and manage my MySQL Database. Where in XAMPP do I store the database? The localhost file path is C:\xampp\htdocs\ and then i have a folder in there called test. As it seems to me now it will be stored in the mysql data folder of xampp (C:\xampp\mysql\data). Do I really link my test site to the database in this fashion? or should I force Navicat to work in the C:\xampp\htdocs\test folder where I will have all my other document for the server? Thanks!
  18. i created a file using this code <html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html> This is what browsers read when I test it locally on my machine: Hello World '; ?> What is going on? I'm using Dreamweaver 8 to edit files and save them and I open them with the Preview/Debug in browser inside Dreamweaver 8. Also please note that I'm have not installed any thing like WAMP or XAMPP. Is that the problem? Thanks!
  19. Thanks for the info. I'll abandon the idea of testing on the server, and setup the website on my home computer. Thanks for setting me straight!
  20. I would like to start playing around with php and running some test scripts on my server (yes it does support php). But I don't want to affect the site I'm currently running nor do I want to have my beta-site searched by search engine's web crawlers. What do I do to make my site unsearchable? Is there a general format that people follow when creating test folders on the their home directory? How can I ensure security? Thanks!
  21. Great idea! Again, great idea and great advice. Looks like I have some planning and research ahead of me. Thanks! I'm sure I'll be back... Cheers!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.