Jump to content

klb

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

klb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks so much, that solved my problem. onto the rest of the problems now!
  2. is it possible to have two open connections to two different mysql dbs at the same time? when i tried it, only the one on the bottom of the list was active. my config file looks like this: //---------------------------------------------// $dbname = 'xxx'; # Database Name $dbuser = 'xxx'; # Database Username $dbpass = 'xxx'; # Database Password $dbhost = 'xxx'; # Database Host $conn2 = mysql_connect($dbhost,$dbuser,$dbpass) or die ("Could not connect to $dbname: ".mysql_error()); mysql_select_db($dbname) or die ("Could not access the database: ".mysql_error()); $dbname5 = 'yyy'; # Database Name $dbuser5 = 'yyy'; # Database Username $dbpass5 = 'yyy'; # Database Password $dbhost5 = 'yyy'; # Database Host $conn = mysql_connect($dbhost5,$dbuser5,$dbpass5) or die ("Could not connect to $dbname5: ".mysql_error()); mysql_select_db($dbname5) or die ("Could not access the database: ".mysql_error()); //--------------------------------------// so i want to be able to do mysql_query($query,$conn2) when i need to access xxx db, but it doesn't seem to work that way. am i doing something incorrectly? any help would be greatly appreciated.
  3. i am running my main script on one server, but including a file from another server in it. the problem is that nothing displays when i include the file from the other server (it should display a simple integer). i have tried include(...) and require_once(....), all to no avail. can anyone tell me why i can't access this script? i'm including files on the same server as the main script in the main script and those are working fine. i'm at a total loss and don't want to have to rewrite everything for the main server as that would require ftping of files and a whole bunch of junk like that. i'm losing my mind, any help would be greatly appreciated.
  4. is there a way to find when a file was last modified in php?
  5. i have 6 scripts, each writing to a text file. in addition, i have an index file with links to all the text files that includes all of these scripts. the problem is that the index file will run one script off the include list and then stop. it's incredibly bizarre to me and i'm not sure why it's happening. can anyone shed some light on this situation for me? thanks!
  6. we had our db server crash (again) and lost some data in the process, and i was thinking for the new system we're making, why not write simultaneously to two different mysql db's on two different servers? that way, if one crashed, we'd have a real time backup that we could move over with very little downtime. is it possible to have two open connections to two databases and then tell mysql which connection to use for which insert statement? and is there a server it would default to so i wouldn't have to declare which server to get all my select statements from? thanks for any insight ....
  7. there should only ever be one row in the db for each orderid, that gets appended to each time a note is added. but your answer helped me figure out that another part of the script was writing to the notes table multiple times instead of appending to the same row. thanks for your help.
  8. it's worth noting also that i commented out the function call and put the query directly in the main page and had the same result.
  9. the code is valid, because it works for some orderids, but here it is, thanks: Function DBGetNotes($orderid) { $query = "SELECT clientnotes FROM notes WHERE orderid = '$orderid'"; $qry = mysql_query($query) or die ("could not get notes " . mysql_error()); $res = mysql_fetch_array($qry); return $res; } then in the main code: $resnotes = $DBQ->DBGetNotes($orderid); $cnotes = $resnotes['clientnotes'];
  10. i have a simple query: SELECT clientnotes FROM notes WHERE orderid = '$orderid' where orderid is a valid orderid in my database. there are two cases: one where the notes return, and one where there are notes in the database but they don't return via php. for the case where they don't return, i have var_dumped the query to the screen and run the exact query in mysqlyog, and it returns results. but the php doesn't return anything. it doesn't error on the query, it simply returns an empty set. i'm baffled! the notes are in the database and sometimes the query works, but apparently only for certain orders. it never sometimes works for one order and sometimes not. it either works for an orderid or it doesn't. can anyone think of anything i might be missing? i checked the database to make sure i had the right one, and i do. i'm frustrated that such a simple query could cause me so much grief! any help would be greatly appreciated.
×
×
  • 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.