Jump to content

spare

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

spare's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, About a week ago, I created a new DB (e...) and put it on the server and edited. ALL FINE THERE However for some reason certain tables in another DB (f...), scripts in separate folder but with the same table names were over written with the information from DB e.. even though DB f.. has not been edited in months, the databases have different admin usernames and passwords, etc. However there are other DB's on the account, in separate folders, with the same table names that have remained untouched. The scripts are located in different folders under different domains. Below are the two files which regulate access to the DB of each site. The folders are password protected so hacking is also impossible. The only way to alter the DB is to access it through the /admin as the sites themselves are not accessible. Is this my problem or a problem with the account host. They are telling me that the it is my problem and asking me to pay $15 for a backup restoration. I don't see how that is possible. BTW the scripts are not mine but CubeCart's. I would appreciate any help. ============================= <?php $glob['dbdatabase'] = 'account_f..'; $glob['dbhost'] = 'localhost'; $glob['dbpassword'] = '************'; $glob['dbprefix'] = ''; $glob['dbusername'] = 'account_username1'; $glob['installed'] = '41'; $glob['rootDir'] = '/home/account/public_html/folderone/foldertwo'; $glob['rootRel'] = '/folderone/foldertwo/'; $glob['storeURL'] = 'http://domain1.com/folderone/foldertwo'; ?> <?php $glob['dbdatabase'] = 'account_e..'; $glob['dbhost'] = 'localhost'; $glob['dbpassword'] = '************'; $glob['dbprefix'] = ''; $glob['dbusername'] = 'account_username2'; $glob['installed'] = '33'; $glob['rootDir'] = '/home/account/public_html/folderone1/foldertwo2 /folderthree3/'; $glob['rootRel'] = '/foldertwo2 /folderthree3/'; $glob['storeURL'] = 'http://www.domain2.com/folderone1/foldertwo2 /folderthree3/'; ?>
  2. Hello, I have a registration form with option menus.  Once a member, the  visitor can alter their information.  In order to prevent them from altering some fields, I have stopped the options menus from updating the db but they still appear as option menus.  I would like the option to just appear as fixed text on the page.  I did this without any problem with the information stored on the db as text but I am having problems with the information stored as numbers.  The options are saved on the db as id numbers which correspond to the options' names (i.e. id# 14 is the id for "Green").  it seems the only way I can have the selected option correctly reappear is in an  options menu. When I try I can only get the first or last option never the option the member chose. I'd appreciate any suggestions. The HTML part [code] <tr>   <td align="right" valign="top"><strong>{TXT_COLOURS}</strong></td>   <td>     <select name="colours" id="colours" class="textbox">                                               <!-- BEGIN: colours_opts -->                                                 <option value="{VAL_COLOURS_ID}" {COLOURS_SELECTED}>{VAL_COLOURS_NAME}</option>                                               <!-- END: colours_opts -->                                               </select>                                                   </td> [/code] A view of the db layout +-----------------------------------------+ | ID | ABV |            NAME                        | +-----------------------------------------+ |  1 | blu |            Blue                            | +-----------------------------------------+ |  2 | red |            Red                            | +-----------------------------------------+ |  3 | yel |          Yellow                          | +-----------------------------------------+ The PHP part [code] $profile->assign("TXT_COLOURS",$profile['colours']); $colours = $db->select("SELECT id, abv, name FROM ".$glob['dbprefix']."Acada_iso_colours ORDER BY name"); for($i=0; $i<count($colours); $i++){ if($colours[$i]['id'] == $acaUserData[0]['colours']){ $profile->assign("COLOURS_SELECTED","selected='selected'"); } else { $profile->assign("COLOURS_SELECTED",""); } $profile->assign("VAL_COLOURS_ID",$colours[$i]['id']); $coloursName = ""; $coloursName = $colours[$i]['name']; if(strlen($coloursName)>40){ $coloursName = substr($coloursName,0,40)."&hellip;"; } $profile->assign("VAL_COLOURS_NAME",$coloursName); $profile->parse("profile.session_true.colours_opts"); } $profile->assign("VAL_COLOURS",$acaUserData[0]['colours']); [/code]
  3. [quote author=thorpe link=topic=105244.msg420319#msg420319 date=1156286745] $regcd is a string... you define it yourself. You then try and reference it as some sort of multidimensional array. $regcd[0]['codename'] Whats with that? [/quote] The onset of complete burnout. :P  I'm getting it..... Oookay.  I got it.  Thanks
  4. Hello, Could somebody please help me.  This is just about to drive me crazy.  I have been beating my head for countless hours over the past two days.  I am trying to add one of those annoying algorythim images to a registration page.  I have a db table with fields named id, code, and codename. I want a random selection of a 'codename' (also the name of an image in a folder).  The results of the 'codename' will, via a switch, display the matching image. The related 'code' field will be required to match what the visitor has entered in the text field on the registration page or else an error message. The basic query works on PHPMyAdmin but the results won't echo on the registration page and echo as 'empty' when I run it on another page. [code] $regcd= "SELECT * FROM ".$glob['dbprefix']."ATC_humanreg WHERE id >0 ORDER BY RAND() LIMIT 1"; $results=$db->mySQLsafe($regcd[0]['codename']); echo '<pre>'; print_r($regcd); echo '</pre>'; echo '<pre>'; print_r($results); echo '</pre>'; [/code] This is what I get back [quote]SELECT * FROM ATC_humanreg WHERE id >0 ORDER BY RAND() LIMIT 1 ''[/quote] When I try [code] $regcd = "SELECT codename FROM ".$glob['dbprefix']."ATC_humanreg WHERE id >0 ORDER BY RAND() LIMIT 1"; $results=$db->mySQLsafe($regcd[0]['codename']); echo '<pre>'; print_r($results); echo '</pre>'; [/code] I get this [quote]''[/quote] Why are the query result not appearing?  What am I doing wrong? I appreciate any help or suggestions.
  5. Hi, The country code is entered into the DB with phpMyAdmin.  It is put directly into the country code field using the edit function.  That is why I don't understand the '--' since it is entered without quotes as 30, 31, etc.  The field type is a char(3) could that cause the single quotes? I'm not a programmer, I just DIY whatever needs doing (car, desktop/laptop, websites, etc) and learn along the way.  I'll be repairing a digital camera in the next few weeks :)
  6. Hi, There isn't any code for adding the country code information.  The country code is entered directly in the database by site admin--just as 30 not '30'. Then it is passed around a few times before being called up on the page that required the switch.  I'm just so glad that it works.  I don't really care about the "'--'" .  The country code information is never view by anyone other than site admin.  Do you think that the extra quotes slow things down or will do so in the future?
  7. It works!!!!  It works!!!!  It works!!!! Thank you!!! Thank you!!!  Thank you !!! It was only the difference in adding the " as well as the ' it would work with either alone only with both. [quote author=448191 link=topic=101585.msg404785#msg404785 date=1154035982] You have to be kidding me. If true, that's just plain wrong! [/quote] Yes,  448191, it is just plain wrong. :) I had tried it without the default case but it used the first case as default. I understand the logic but it is just TOO logical for me ;) I would have never thought of it.
  8. Hi, Still no luck.  Even with the single quotes '30'.  When I ask it to echo the $bookNumberpart1 it comes up blank. Yes, $country_codequery is a query result--see below.  That bit of code was actually Ken's suggestion. Here are print_r for several queries and the results. --print_r($dataArray)-- (     [0] => Array         (             [bookId] => 38             [bookCode] => TOT812             [quantity] => 1             [booktitle] => Test Book             [description] => Description             [description1] => -             [description2] => -             [description3] => -             [description4] => -             [description5] => -             [description6] => -             [description7] => -             [description8] => -             [description9] => -             [description10] => -             [description11] => -             [description12] => -             [image] => Test1.jpg             [info] => 1.00             [info0] => -please login-             [info30] => 300             [info31] => 311             [info32] => 322             [book_number] => 000             [stock_level] => 0             [useStockLevel] => 0             [noBooks] => 4 --print_r($concodequery)-- SELECT * FROM Poesie_login WHERE countrycode = '30' --print_r($country_codequery)-- '30'
  9. Hello, I appreciate all of the help.  I have tried using just "case 30:" and "($country_codequery = 30)" with and without the "==" still I am not getting the correct response.  I only get the default or nothing.  I added an echo "Book number $bookNumberpart1";  after the switch to see what the value is but it is blank.  The  echo "Country code $country_codequery"; is still coming up with the right answer.  I only had a few hours this evening to try it.  I'm going to play around with it tomorrow and I will see what happens. As for <?php $infonum = ($country_codequery >= 30 && $country_codequery <= 32)?$country_codequery:'00'; $bookNumberpart1 = $dataArray[0]['info'.$infonum]; ?> it interests me.  If I were to keep adding other country codes, would I use =, ==, or must I use <>.
  10. Hello, I am trying to get a switch statement to work but I am getting only the first case no matter the variable's value.  I know that the information is being passed from the database to the page because when I echo the variable the value is correct.  I would appreciate it if someone could help me or tell me if a switch statement is the wrong way to go about this. Regards The information appearing on the page varies depending on the country code of the person logged in. [code] $country_codequery = $db->mySQLsafe($VisitorData[0]['country_code']); echo "Country code $country_codequery"; switch ($country_codequery) { case ($country_codequery = 30):   $bookNumberpart1 =($dataArray[0]['info30']);   break; case ($country_codequery = 31):   $bookNumberpart1 =($dataArray[0]['info31']);   break; case ($country_codequery = 32):   $bookNumberpart1 =($dataArray[0]['info32']);   break; default:   $bookNumberpart1 =($dataArray[0]['info00']);   break; } $bookNumber = bookNumber($bookNumberpart1[0],$dataArray[0]['book_number']); if(bookNumber($bookNumberpart1[0], $dataArray[0]['book_number'])==FALSE) { $book_view->assign("TXT_INFO",codeFormat($bookNumberpart1[0])); } else { $book_view->assign("TXT_INFO","<span class='txtOldInfo'>".codeFormat($bookNumberpart1[0])."</span>"); }[/code]
×
×
  • 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.