pwbiggs
Založený: 18.12.2007
Príspevky: 7
Zaslal: 2007-12-18 21:36
Návrat hore
Odpovedať s citátom
|
I thought I'd try phpMyEdit as I'm hoping it will save me lots of donkey work as I have a MySQL db with a large number of fields.
When I run phpMyEdit.setup for the first time I just get a blank screen. If I look at the source code I get this:
| Kód: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>phpMyEdit Setup</title>
<style type="text/css">
<!--
body { font-family: "Verdana", "Arial", "Sans-Serif"; text-align: left }
h1 { color: #004d9c; font-size: 13pt; font-weight: bold }
h2 { color: #004d9c; font-size: 11pt; font-weight: bold }
h3 { color: #004d9c; font-size: 11pt; }
p { color: #004d9c; font-size: 9pt; }
table { border: 1px solid #004d9c; border-collapse: collapse; border-spacing: 0px; }
td { border: 1px solid; padding: 3px; color: #004d9c; font-size: 9pt; }
hr
{
height: 1px;
background-color: #000000;
color: #000000;
border: solid #000000 0;
padding: 0;
margin: 0;
border-top-width: 1px;
}
-->
</style>
</head>
<body bgcolor="white">
|
which looks very similar to the problem logged by Vto in
http://opensource.platon.sk/forum/projects/viewtopic.php?t=197
that was back in 2003 and I didn't understand the answer anyway.
I'm running Windoze XP (with all the latest updates), PHP 5.2.1, MySQL 5.0.22 and Apache 2.2.4.
My PHPInfoTest works OK, as does my own PHP files which call up fields from my two existing databases.
I'm not a total newbie but I dare say it's something obvious I'm not doing.
I call setup using
http://localhost/localhost/phpMyEdit-5.7.1/phpMyEditSetup.php
don't worry about the localhost/localhost, I've got a directory in my htdocs which I've called localhost which is where I do my testing, and another site called imagefair for my site that will eventually be uploaded.
The path for the setup file is C:\WebDev\Apache\htdocs\LocalHost\phpMyEdit-5.7.1 with the extns, images and language directories below them.
Hope someone can help, or I've a lot of tiresome hand coding to do.
Thanks
|
pwbiggs
Založený: 18.12.2007
Príspevky: 7
Zaslal: 2007-12-19 00:42
Návrat hore
Odpovedať s citátom
|
Hadn't thought of that. Just unset read-only for phpMyEdit-5.7.1 and sub directories, but it didn't make any difference.
Good idea though as stuff unzipped from the internet can arrive with read-only set.
|
pwbiggs
Založený: 18.12.2007
Príspevky: 7
Zaslal: 2007-12-19 01:08
Návrat hore
Odpovedať s citátom
|
Progress.
My php.ini has 'error_reporting = E_ALL & ~E_NOTICE' and 'display_errors = On' which I take to mean that errors are displayed.
I took out the '@'s (there's a lot of them!) and got
| Citácia: |
| Fatal error: Call to undefined function mysql_pconnect() in C:\WebDev\Apache\htdocs\LocalHost\phpMyEdit-5.7.1\phpMyEditSetup.php on line 165 |
Line 165 is
| Citácia: |
| $dbl = mysql_pconnect($hn, $un, $pw); |
I tried changing it to mysqli_pconnect... as all the calls I have used so far are the 'i' variant but it didn't change the error.
Now I have that error message to work with I can do more research, but if you've any ideas that would fix it I'd appreciate it.
Thanks for this progress anyway.
|
pwbiggs
Založený: 18.12.2007
Príspevky: 7
Zaslal: 2007-12-19 01:45
Návrat hore
Odpovedať s citátom
|
The only persistent in my phpinfo is in the odbc section.
I tried mysql_connect instead of pconnect and got the same error.
How do you mean 'use a different db connection' and how do I apply that large code section and what does it do?
I can't understand how or why the code should want to make a connection at this point before I've even given it a hostname, username or password. Presumably they are some sort of industry wide default used to find the SQL server?
|
pwbiggs
Založený: 18.12.2007
Príspevky: 7
Zaslal: 2007-12-19 02:17
Návrat hore
Odpovedať s citátom
|
Hmmm, that didn't work either with a username, password and database I know works in my code. I took out all the '@'s again and got the same error message, line 15 this time. Also tried the connect version.
It's gone 1 o'clock in the morning here now so I'll have to leave any more suggestions, assuming hopefully you have some for me, until the morning.
It's obviously going to be something with my setup rather than phpMyEdit being the problem.
If it helps, the database I tried to connect to I can connect to OK using
| Kód: |
| mysqli_connect($host,$user,$password,$dbname) |
|
pwbiggs
Založený: 18.12.2007
Príspevky: 7
Zaslal: 2007-12-19 02:28
Návrat hore
Odpovedať s citátom
|
Additional...
If I rewrite those first few lines like this;
| Kód: |
$host = "localhost";
$user = "Phillip";
$password = "helloagain";
$dbname = "inventory";
$table="household_inventory";
$persistent = '';
if($persistent == (bool) ini_get('allow_persistent')){
if(!$opts['dbh'] = mysqli_connect($host,$user,$password,$dbname)){
die(mysql_error());
} |
I get to line 31 before hitting the next error. I'll look into it more tomorrow, but it seems odd that my method worked.
Notice this uses the connect method. If I put in the pconnect method it errors again. Also, I use Zend Development and you know the auto-complete feature of these enviroments, well there isn't an auto complete for pconnect.
|
pwbiggs
Založený: 18.12.2007
Príspevky: 7
Zaslal: 2007-12-19 16:05
Návrat hore
Odpovedať s citátom
|
Going back to the original program. phpMyEdit's first piece of php code is;
| Kód: |
<?php
if (! defined('PHP_EOL')) {
define('PHP_EOL', strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? "\r\n"
: strtoupper(substr(PHP_OS, 0, 3) == 'MAC') ? "\r" : "\n");
}
echo "LINE 61 <br><pre>"; var_dump($_POST); echo "</pre>";
$hn = $_POST['hn'];
$un = $_POST['un'];
$pw = $_POST['pw'];
if(strlen($_POST['db'])>0) $db = $_POST['db'];
if(strlen($_POST['tb'])>0) $tb = $_POST['tb'];
$id = $_POST['id']; |
The "echo 'Line 61... " bit is mine. My point is that this echo reveals an empty array, which to my way of thinking isn't surprising as I haven't got as far as posting anything yet. Not surprisingly therefore I get the
| Kód: |
| Fatal error: Call to undefined function mysql_connect() in C:\WebDev\Apache\htdocs\LocalHost\phpMyEdit-5.7.1\phpMyEditSetup.php on line 165 |
when mysql_connect tries to use the $hn, $un, $pw values which are empty.
Is the start of the code supposed to look like this? It almost seems like I should be calling another program before this one.
|
|
Odoslať novú tému
Odpovedať na tému
|