UzziSoft Forum Index UzziSoft
Provider of free downloads and services - www.uzzisoft.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PHP Simple CVS

 
Post new topic   Reply to topic    UzziSoft Forum Index -> Other Projects / Content
View previous topic :: View next topic  
Author Message
debug



Joined: 16 Apr 2007
Posts: 2

PostPosted: Mon Apr 16, 2007 4:25 am    Post subject: PHP Simple CVS Reply with quote

Hello,

I hope this is the right forum. I recently downloaded and installed "PHP Simple CVS" on my windows machine running mySql and PHP 5. After some trouble initally getting the web-app to see my CVSROOT direcotry I ended up creating a junction from the htdocs folder so I could relocate the directory.

The index.php loads now using an alias from the web-server and can see the correct junction (symlink) direcotry off the other drive. But, everytime I try to upload a file I get the following error:

Code:
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 15 in E:\Websites\PHP Simple CVS v1.0\cvs.php on line 249


The file is being uploaded the correct junction point after I modified the php.ini for upload_tmp_dir, but the filedata table is always empty after every try.
I used this command to spot check the table:
Code:
select * from filedata;


the result was:
Code:
Empty set (0.00 sec)


I'm not very good at php or mysql, what I've done so far has taken me an entire weekend just to read-up and understand. Since uzzisoft.com is the orginal owner I was wondering if you could help me. Thanks for your time.

I'm willing to try anything for testing. I even have an sql script that will erase and recreate the dB if I need to flush and startover. I should mention the user account to the dB has SUPER rights. Smile

Let me know if you need anymore infomation and thanks again.

::debug::
Back to top
View user's profile Send private message
alexi02
Site Admin


Joined: 17 Aug 2004
Posts: 230
Location: Brisbane, Australia

PostPosted: Mon Apr 16, 2007 11:39 am    Post subject: Reply with quote

Hi,

PHP Simple CVS was designed for PHP4 and therefore wasn't tested on PHP5.

When installing say you copied the cvs files to htdocs/cvs. Did you set the CVS Main Dir to /cvs ?
The CVS Dir can be anything you like, such as, /files which will be created in the CVS Main Dir you specified. I should of included more documentation.


That error on line 249 seems to be about the file version. So I assume the file does exist in the CVS directory which means that it isn't inserting the file information into the database.

Firstly try to run this query in MySQL but change the files/ directory to your CVS Dir and filename to the filename of the file you uploaded:

Code:
INSERT INTO `filedata` (`filename`, `fileversion`, `changelog`, `loc`) VALUES ('mycvsdir/myfile.txt', '0', '', 0);


Then try running the cvs.php page again.


You could also try to check the variables in cvs.php when inserting the file information.

Find
Code:
// Insert the file name and version number as 0 into the DB
            mysql_query("INSERT INTO filedata VALUES ('$currentdirnoslash/$file_name','0','','')");


Before Add
Code:
die ("$currentdirnoslash, $file_name");



Alex.
_________________

UzziSoft Administrator
Back to top
View user's profile Send private message Send e-mail Visit poster's website
debug



Joined: 16 Apr 2007
Posts: 2

PostPosted: Mon Apr 16, 2007 10:37 pm    Post subject: Reply with quote

Hi Alex,

First thanks for making available this web-app I hope to find it extremely useful for all my tweaks and whatnot. To answer your question here is my setup (I hope it helps)

I have an alias set to mydomain.com/cvs which points to the my e:\websites directory. The CVS main I used from root was / the CVS Dir I used was /CVSROOT

Now I'm guessing the app doesnít handle alias nicely because it was expecting CVSROOT directory in the htdocs folder. I created a junction (or symlink) folder to my e:\websites\PHP Simple CVS v1.0\CVSROOT and the program stopped complaining about the directory problems. I can even upload files and they stay intact itís just now this mysql error that is killing me.

I tried the following things you recommended. The test against the MySQL dB using this command:

Quote:

INSERT INTO `filedata` (`filename`, `fileversion`, `changelog`, `loc`) VALUES ('mycvsdir/myfile.txt', '0', '', 0);


was successful. The result was:

Code:

Query OK, 1 row affected (0.09 sec)


after running the cvs.php again the error disappeared. So it looks like the data to enter MySQL isnít happening. Next I tried adding the die statement above the insert command in the cvs.php file and the result was:

Code:

CVSROOT,test.bat


I adjusted the die statement to reflect the actual insert like so (just to test):
Code:

die ("$currentdirnoslash/$file_name);


which showed a correct value for insertion on the filename column for the db...

Code:

CVSROOT/test.bat


Another full point-n-click test using the web-app failed. QQ is it possible to echo the return value from the mysql_query? I'm wondering the mySQL is complaining about something we've missed. --actually I just looked again and it appears that the 'loc' field is expecting an interger so I changed the line

Code:

// Insert the file name and version number as 0 into the DB
mysql_query("INSERT INTO filedata VALUES ('$currentdirnoslash/$file_name','0','','')");


to places the last value to 0 so that it reads now:

Code:

// Insert the file name and version number as 0 into the DB
mysql_query("INSERT INTO filedata VALUES ('$currentdirnoslash/$file_name','0','',0)");


which seems to work now. I would still be interesting to know if we can die on bad mysql returns. Let me poke around some more to see if anymore errors occur throughout the program.

BTW, did I mention thanks for such hardwork on this. I don't think people understand how much of nice a program it really is. Smile

Talk to you alter,

::debug::
Back to top
View user's profile Send private message
alexi02
Site Admin


Joined: 17 Aug 2004
Posts: 230
Location: Brisbane, Australia

PostPosted: Mon Apr 16, 2007 11:15 pm    Post subject: Reply with quote

Good on you for fixing the problem! Smile

I think you could do this:
Code:
mysql_query("INSERT INTO filedata VALUES ('$currentdirnoslash/$file_name','0','',0)") or die ('Failed to insert file information because: ' . mysql_error());

_________________

UzziSoft Administrator
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    UzziSoft Forum Index -> Other Projects / Content All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group