Jump to content

gBase

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by gBase

  1. Great!  That fixed that problem... however, now the script runs but the text boxes don't have the values from the ID strings that I passed to them on the previous page...they are blank.  In $formVars do I have to change the row to the # row that my values actually have (tried this and it didn't seem to work)?  And/or do I have to put that row # anywhere in the form values(hacked around a little with this too but didn't seem to work either)?  Thanks again!  ;D EDIT: Nevermind, figured it out (was problem on form that submitted to this one.)
  2. Hi, my database application is working great...I'm now trying to implement a feature to allow the user to update the records.  But I'm getting this error: [code]Parse error: syntax error, unexpected T_AS in /sysdocupdate.php on line 1[/code] Here's my code: [code] <?php foreach($HTTP_POST_VARS as $varname => $value)         $formVars[$varname]=$value; require_once("config.php"); $db1=mysql_connect($dbhost, $dbuname, $dbpass); mysql_select_db("sysops"); $query="SELECT * FROM systemsdoc WHERE UID = \"".$formVars["UID"]."\""; $result=mysql_query($query); $row=mysql_fetch_array($result); $formVars = array(); $formVars["manu"]=$row["manu"]; $formVars["model"]=$row["model"]; $formVars["addr"]=$row["addr"]; $formVars["zip"]=$row["zip"]; $formVars["phone"]=$row["phone"]; $formVars["deploy_date"]=$row["deploy_date"]; $formVars["sernum"]=$row["sernum"]; $formVars["assetnum"]=$row["assetnum"]; $formVars["machname"]=$row["machname"]; $formVars["sysversion"]=$row["sysversion"]; $formVars["UID"]=$row["UID"]; mysql_close($db1); ?> [/code] Is it the foreach loop that's the problem? I'm using this website for my code: [url=http://www.netadmintools.com/art332.html]http://www.netadmintools.com/art332.html[/url] Thanks for any help!
  3. Great!  I'm all set, thanks everybody!  ;D
  4. Thanks...that must be it!  Only problem: I'm using phpMyAdmin 2.8.02 and I don't see anything for privileges or permissions...I wish there was a phpmyadmin forum I could ask on.  The application is pretty user friendly for the most part, but I can't find anywhere to modify my permissions.  The plus side is I'm able to access the db now from my other user (non root.)  So I'm OK with that for now, but if you happen to know of where to find the permissions stuff that'd be a big helpf or my personal knowledge.  Thanks for your help!
  5. Thanks for your help with my code however I am still getting this: [code]Connected successfully. Could not select the database '': Access denied for user 'root'@'localhost' to database 'my_database'[/code] If you guys think there may be an issue with my server (which I am starting to suspect) I can probably get this straightened out with tech support.  I just wanted to know if there was more PHP code I could write that could help me troubleshoot this further.  Thanks and please let me know what you reccomend trying next!
  6. In other words, I type in one of the databases on my server, and I get 'Could not select the databases, are you sure it exists?' Here's my code: [code]<?php     // connect and select a database     $link = mysql_connect("localhost", "root", "mypassword")           or die     print "Connected successfully.<br>";     $db = "my_database";     mysql_select_db($db) or die("Could not select the database '" . $db . "'.  Are you sure it exists?"); ?> [/code] So, I know I connected to my server successfully because it says "Connected Successfully." I actually already tried adding to this code: [code]$sql = 'SHOW DATABASES';[/code] But when I try the page again I still get the same message and it doesn't show any databases.  I created 2 databases on my server and I can see them in phpmyadmin.  Is there a problem with my server possibly?
  7. My PHP code to connect and select a database is working great...problem is it connects successfully but doesn't sync up with the databases I type into the code and am sure are on my server.  Is there a query I can type in PHP that says (after connecting successfully) 'print a list of all databases found in host' (localhost?)  Thanks for any help...new to some of this stuff.
×
×
  • 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.