Jump to content


Photo

PHP/mySQL Related help needed.


  • Please log in to reply
2 replies to this topic

#1 Chesso

Chesso
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 21 September 2006 - 06:14 AM

I run WAMP5 (PHP 5 something and mySQL 5 something and Apache 2 something) locally on my Windows XP machine for building and testing my site.

It works flawlessly but I am not seeing the same results on my web host. They use as far as I know: PHP version  4.4.2, Apache version  1.3.36 (Unix), MySQL version 4.0.27-standard.

The problems I am having at this moment is news posting (when sometimes adding or modifying it fails and the query is not forfilled, but it's random when it happens).

I also get errors for trying to use mysql_close(); even though it may be possible it wasn't used or already closed (in my footer) but I use mysql_close() or die();, I don't know any other way to stop it from trying if a connection isn't open, so it outputs the darn error anyway.

Mostly what I am looking for is any advice on any differences between V5 of PHP/mySQL and V2 of apache compared to the V4 PHP/mySQL and V1 apache that might cause such problems.

#2 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 21 September 2006 - 08:51 AM

First, WAMP stands for
Windows
Apache
MySQL
PHP
(Instead of the Standard LAMP on the server
Linux
Apache
MySQL
PHP)

Second:
I have been involved in a discussion somewhere, saying that most people dont use mysql_close() as the connection closes when the page finishes loading anyway

There are some differences in functions between php V5 and V4.
The main differences would be down to your php.ini settings

You are saying the form is coming up blank
check that
if you are using the POST method (<form method='post')
You call the variabled as follows
$_POST["fieldname"];
where field name is the name you have the field
<input type='text' name='THIS IS THE FIELD NAME' />

if your using the GET method (<form method='get'>
You do the same as above, but you use GET not POST
$_GET["fieldname"];

If your still having a problem, post some code, for us to look into
Tell me the problem, I will try tell you the solution

#3 Chesso

Chesso
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 21 September 2006 - 09:40 AM

It's not the form that seems to be the problem, it is the sql.

As I said works locally, but on the web host it randomly does not put the sql in, or when I do a news post edit, it makes it completely blank, so it in effect deletes the content but does not update it :S.

I use $_REQUEST which handles both $_GET and $_POST. Iv'e heard using this isn't so great security wise, but functionality wise it hasn't caused a problem before.

All I really did from the original that worked both for local and web host is use a new design, so not much if any of the php and sql was really touched at all besides some mysql_close(); statements and such being removed.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users