
tthdoc
Members-
Posts
15 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
tthdoc's Achievements

Newbie (1/5)
0
Reputation
-
OK finally figured in out. Insert will insert rows (duh). I want to update. So for anyone who wants to do the same thing, here is what I used: UPDATE joom_stories s SET votes1 = (SELECT (total_value/total_votes) FROM joom_ratings r WHERE s.id=r.id) Doc
-
Ok, now for another problem. I tried your solution as well as: INSERT INTO joom_stories (votes1) SELECT (total_value/total_votes) FROM joom_ratings,joom_stories WHERE id=joom_ratings.id Both ways seemed to do the same thing. When I went to the tables, it added a new row for each transfer. So instead of having, say 50 rows in stories and 50 rows in ratings, I end up with 100 rows in stories (and no value in votes 1 of the existing 50 rows changed) and still 50 in ratings. So instead of matching the id's and replacing the votes value, it just keeps adding more id numbers. Doc
-
Could use some help. I am overlooking something here but can't figure it out. I have a database with a table with 3 columns - id, total_value and total_votes. I have a second table with 2 columns id and votes1. What I need is the number total_value/total_votes to be inserted into the votes column, and making sure the id's match. Here is the SQL statement I tried but get an error. INSERT INTO joom_stories (votes1) SELECT (total_value/total_votes) FROM joom_ratings WHERE joom_stories.id=joom_ratings.id I get this error.. #1054 - Unknown column 'joom_stories.id' in 'where clause' Thanks, Doc
-
Need some beginning help with developmental server..
tthdoc replied to tthdoc's topic in PHP Installation and Configuration
OK, finally solved part of the problem. I redid the GREP in pieces and found the file at fault. It was the template file. The beginning of that file was <? instead of <?php. When I changed it, the text at the top went away. I guess my host is more forgiving of this then easyphp is. I still cannot figure out why no menu items are there. I do have a bottom menu which shows up. And I went to the database and all the menu item entries are there, but if I go to the joomla administrator settings and look at the menu items, they all show no items, even the bottom menu. Very weird. If anyone has any ideas, I would appreciate the help. Doc -
Need some beginning help with developmental server..
tthdoc replied to tthdoc's topic in PHP Installation and Configuration
In Easyphp administration screen when you scroll over the port number (not changeable) it says -
Need some beginning help with developmental server..
tthdoc replied to tthdoc's topic in PHP Installation and Configuration
I'm not sure if we are talking about the same thing. For your 1st question, I have a file in the main directory called test.php (in 127.0.0.1:8888/test.php) as follows: <?php $hostname = "localhost"; $dbuser = "root"; $dbpassword = ""; $link = mysql_connect($hostname,$dbuser,$dbpassword); if (!$link) { die('Could not connect to MySQL: ' . mysql_error()); } echo 'Connection OK'; mysql_close($link); ?> This returns Connection OK. This should answer the question if any php works. As to the code in the first post, let me explain a little further. Lets say I did all this with phpfreaks.com. If you look at the main page (of phpfreaks) you see the whole site and a menu bar (Home, tutorials, blog, etc). At the top is a grey bar that has Subsribe to phpfreaks rss. What I am ending up with is the site as shown, but there is nothing in the menu bar (no words or links), and ABOVE the top grey bar is the text as shown in the first post. I cannot figure out where this is coming from, and why the site seems to be there with those couple of problems. Otherwise, the site seems to work on the local server, just this stuff at the top I can't figure out. I even took a snippet of the text and tried to GREP on the phpeasy entire folder with no results. Doc -
Need some beginning help with developmental server..
tthdoc replied to tthdoc's topic in PHP Installation and Configuration
Not sure what you are asking by the opening php tag, so let me know if this is wrong. In the main directory (mydomain) do you mean the index.php file? If so, here is that code. <?php /** * @version $Id: index.php 11407 2009-01-09 17:23:42Z willebil $ * @package Joomla * @copyright Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // Set flag that this is a parent file define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(__FILE__) ); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null; /** * CREATE THE APPLICATION * * NOTE : */ $mainframe =& JFactory::getApplication('site'); /** * INITIALISE THE APPLICATION * * NOTE : */ // set the language $mainframe->initialise(); JPluginHelper::importPlugin('system'); // trigger the onAfterInitialise events JDEBUG ? $_PROFILER->mark('afterInitialise') : null; $mainframe->triggerEvent('onAfterInitialise'); /** * ROUTE THE APPLICATION * * NOTE : */ $mainframe->route(); // authorization $Itemid = JRequest::getInt( 'Itemid'); $mainframe->authorize($Itemid); // trigger the onAfterRoute events JDEBUG ? $_PROFILER->mark('afterRoute') : null; $mainframe->triggerEvent('onAfterRoute'); /** * DISPATCH THE APPLICATION * * NOTE : */ $option = JRequest::getCmd('option'); $mainframe->dispatch($option); // trigger the onAfterDispatch events JDEBUG ? $_PROFILER->mark('afterDispatch') : null; $mainframe->triggerEvent('onAfterDispatch'); /** * RENDER THE APPLICATION * * NOTE : */ $mainframe->render(); // trigger the onAfterRender events JDEBUG ? $_PROFILER->mark('afterRender') : null; $mainframe->triggerEvent('onAfterRender'); /** * RETURN THE RESPONSE */ echo JResponse::toString($mainframe->getCfg('gzip')); Doc -
Need some beginning help with developmental server..
tthdoc replied to tthdoc's topic in PHP Installation and Configuration
Thats just the way it is setup in the easyphp administration panel. The URL is: http://127.0.0.1:8888/mydomain/ -
Not quite sure which forum to post this, so please move it if needed... I have put my website up and running, and I wanted to start making some changes, but don't want to disrupt the live site. So I am trying to learn, understand, and start with a local server setup. I have setup easyphp and want to make sure I understand everything before I begin. If anyone knows of some good online tutorials, that would be great. Here is how I understand things, please correct me if I am wrong. Currently I use bluehost and have an addon domain (mydomain.com). I went to public_html and copied the mydomain folder to my easyphp folder in the www directory. I exported the database file (data.sql) as well. The database was set up on bluehost as database mydata with the _joom tables. As there are multiple databases, when I go to mydata it show main_mydata. So I went to easyphp administration, clicked on phpmyadmin, and added a new database called mydata. I then imported the data.sql file and all the tables are there. I then went to configuration.php and changed the username, password, and database to the new names. Also had a second configuration file for the database in another folder and changed them. When I click on the folder in www, my site comes up but no menu items are there and there is text at the top: $v) {if($an==''&& $v>$f) { $an = $p; if($s<66) { $u = base64_decode("aHR0cDovL3d3dy5qb29tbGFzaGFjay5jb20=");} else { $u = base64_decode("aHR0cDovL3d3dy5qb29tbGFzaGFjay5jb20=")."/".$l[$p]; }foreach($e as $es=>$k) {if($el=='' && $k>$t) { $el = $es; }}}}$jstpl = base64_decode("PGEgaHJlZj0n").$u.base64_decode("Jz4=").$an.base64_decode("PC9hPg==").$el;?> What did I do wrong or what am I missing? thanks Doc
-
Thanks so much, that worked perfect. Doc
-
Thanks for the quick reply. I was actually looking for exactly how to phrase the query, my database knowledge is limited. Could you be more specific on how to do it? Thanks again Doc
-
I need to copy data and want to make sure I do it correctly. To make it easy to understand what I am trying to do, I have 2 tables. Table1 has 2 fields - ID and Name. Table2 has 4 fields - ID, First, Middle, Last. What I want to do is copy the data from the Name field on table1 and put it in the First field on table2. The same ID numbers are in both tables right now. When I look at the two tables I see as example this: Table1 ID Name 2 John 4 Mary 5 Joe Table2 ID First Middle Last 1 Jones 2 Smith 3 Jackson 4 Gold 5 Ray What I don't want is to end up with ID1 being John Jones ID2 being Mary Smith and ID3 being Joe Jackson. In other words, since the id's order is different in the two tables, I want to make sure they are matched so I end up with ID1 still is just Jones, ID2 is John Smith, ID3 is just Jackson, ID4 is Mary Gold, and ID5 is Joe Ray. Thanks for the help in advance, Doc
-
Thanks so much, that did it. Doc
-
Thanks for the quick reply, but no it does not work. I realized when I looked at the post it stripped out some of the text. So I am going to try to use the php tags around it. Here is the $this... ViewList Object ( [_name] => list [_models] => Array ( [list] => ModelList Object ( [_data] => Array ( [0] => stdClass Object ( [id] => 70 [catid] => 1 And here is the $this->models... Array ( [list] => ModelList Object ( [_data] => Array ( [0] => stdClass Object ( [id] => 70 [catid] => 1 Hopefully it does not remove anything this time. It is the list surrounded by brackets that is throwing me... Thanks again. Doc
-
I am working on modifying some code and wanted to check some variables, but am stuck on something that is probably simple, just over my head. If I do the following: print_r ($this); I get this result (I used PRE tags to format it) ViewList Object ( [_name] => list [_models] => Array ( => ModelList Object ( [_data] => Array ( [0] => stdClass Object ( [id] => 70 [catid] => 1 etc...... Moving down, I typed this... print_r ($this->_models); and get this... Array ( => ModelList Object ( [_data] => Array ( [0] => stdClass Object ( [id] => 70 [catid] => 1 How would I get, for instance, the id? If I try print_r($this->_models->list); nothing happens. In other words, if I wanted to return the id, what would it be -- $this->_models->??? . I tried all kinds of combination's and other ways to do it, just can't figure it out. I know it is my limited knowledge with PHP , so could someone point me in the right direction. Thanks, Doc