-
Posts
159 -
Joined
-
Last visited
Never
Everything posted by $username
-
Hello PHP guys, Here is a new one I dont understand why the is not working. Here are the errors Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in line 51 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in line 51 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in line 57 Here are those lines. $query=("SELECT * FROM userlogin ORDER BY `ID` DESC LIMIT 0,80"); mysql_query($query); Thank you, Brett
-
Thanks guys, Brett
-
Ok PHP people, I would like an if statement if a value is not present to us a default value. Let me know if this is how it can be done. if ($Ord == "") $Ord = 'ID'; else $Ord = $_GET['Ord']; $sql = "SELECT * FROM store ORDER BY `$Ord`"; Thank you, Brett
-
[SOLVED] Help With Character Replacement
$username replied to PHPNewbie55's topic in PHP Coding Help
ereg_replace("[^A-Za-z0-9.;:@]", "", any thing that is between [] will not be replaced. Hope this helps. Brett -
This is how I fixed it. <?php if (isset($_COOKIE["user"])) setcookie("user", ($_COOKIE["user"]), time()+600); else header("Location:cookerr.htm"); //echo "Welcome guest!<br />"; ?> <?PHP include 'dbopen.php'; include 'dbconnect.php'; $username = $_COOKIE["user"]; $result1 = "SELECT UsrRights FROM admin WHERE username = '$username' "; $result2 = "SELECT username FROM admin WHERE username = '$username' "; $query1 = mysql_query($result1); $query2 = mysql_query($result2); list($usrrights) = mysql_fetch_row($query1); list($username2) = mysql_fetch_row($query2); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <link href="./css/master.css" rel="stylesheet" type="text/css" /> </script> <html> <div id="nav-menu"> <ul> <li><a href="show.php">Show Cases</a></li> <li><a href="write.php">Add New Case</a></li> <li><a href="showusers.php">Show Clients</a></li> <li><a href="logoff.php">Log Off</a></li> </ul> </div> <?PHP echo "$username Username"; echo "$usrrights username2 "; echo "$username2 userrights"; ?>
-
Here is the value in the database. password username ID secvalue UsrRights 5F4DCC3B5AA765D61D8327DEB882CF99 test 1 1 120
-
test UsernameResource id #7 username2 Resource id #8 userrights This is what I get when I do not use '' around the table name And this is what I get for the MYSQL error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin' WHERE username = 'test'' at line 1
-
In my code I am trying to SELECT username and UsrRights When I Echo out the SQL query I do not get anything back. Why am I not getting anything echoed back? include 'dbopen.php'; include 'dbconnect.php'; $username = $_COOKIE["user"]; $sql = mysql_query ("SELECT UsrRights FROM 'admin' WHERE username = '$username' "); $sql2 = mysql_query ("SELECT username FROM 'admin' WHERE username = '$username' "); $usrrights = $sql; $username2 = $sql2; ?> <div id="nav-menu"> <ul> <li><a href="show.php">Show Cases</a></li> <li><a href="write.php">Add New Case</a></li> <li><a href="showusers.php">Show Clients</a></li> <li><a href="logoff.php">Log Off</a></li> <li><?php if ($username == $username2 && $usrrights == 120) echo "<a href=\"logoff.php\">Log Off</a>"; ?> </li> </ul> </div> <?PHP echo "$username Username"; echo "$username2 username2 "; echo "$usrrights userrights"; ?> Thank you, Brett
-
pls help, how can i connect php to mysql?
$username replied to homer.favenir's topic in PHP Coding Help
Post some of the code you are using so we can take a look at so we can point you in the right direction. Brett -
I dont think I understand what you are looking to do. If you have any code that you can post or something to make this a little more clear that would be great. Brett
-
pls help, how can i connect php to mysql?
$username replied to homer.favenir's topic in PHP Coding Help
You can google search it and you will find lots of help on this. Brett -
I found it. It was a miss quote $message', This fixed it. Brett
-
I need help i dont know what to do they said it was easy
$username replied to 486974's topic in PHP Coding Help
you may have to set the password to old. What version of MYSQL are you using. Here is what I have to do. UPDATE mysql.user SET password=OLD_PASSWORD('somepassword') WHERE user='someuser' AND host='somehost'; update mysql.user set -> password = old_password('1234') -> where user = 'root'; Brett -
Here is an error I am getting with this code. Any Ideas why? You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '', 'type1', '123123', 'Size1')' at line 1 <?php } else { $fname = $_POST['fname']; $lname = $_POST['lname']; $org_name = $_POST['org_name']; $st_address = $_POST['st_address']; $city_name = $_POST['city_name']; $state_name = $_POST['state_name']; $postal = $_POST['postal']; $country = $_POST['country']; $email_address = $_POST['email_address']; $work_phone = $_POST['work_phone']; $fax_number = $_POST['fax_number']; $subject = $_POST['subject']; $message = $_POST['message']; $type_t = $_POST['type_t']; $size_t = $_POST['size_t']; $amount_t = $_POST['amount_t']; mysql_query("INSERT INTO `bbsew_email_list` (fname, lname, org_name, st_address, city_name, state_name, postal, country, email_address, work_phone, fax_number, subject, message, type, amount, size) VALUES ('$fname', '$lname', '$org_name', '$st_address', '$city_name', '$state_name', '$postal', '$country', '$email_address', '$work_phone', '$fax_number', '$subject', $message', '$type_t', '$amount_t', '$size_t')") or die(mysql_error()); echo "Your Info Has Been Added "; }
-
Is this a new xml file that you are creating? I think that you could use XML with the DOM... But I do not know to much about this yet. I have been working on this a little <?php $books = array(); $books [] = array( 'title' => 'PHP Hacks', 'author' => 'Jack Herrington', 'publisher' => "O'Reilly" ); $books [] = array( 'title' => 'Podcasting Hacks', 'author' => 'Jack Herrington', 'publisher' => "O'Reilly" ); $doc = new DOMDocument(); $doc->formatOutput = true; $r = $doc->createElement( "books" ); $doc->appendChild( $r ); foreach( $books as $book ) { $b = $doc->createElement( "book" ); $author = $doc->createElement( "author" ); $author->appendChild( $doc->createTextNode( $book['author'] ) ); $b->appendChild( $author ); $title = $doc->createElement( "title" ); $title->appendChild( $doc->createTextNode( $book['title'] ) ); $b->appendChild( $title ); $publisher = $doc->createElement( "publisher" ); $publisher->appendChild( $doc->createTextNode( $book['publisher'] ) ); $b->appendChild( $publisher ); $r->appendChild( $b ); } echo $doc->saveXML(); ?>
-
Ok let me give this one more shot. This is your current code $main = include('dining_include.php'); function dining() { global $main; include 'dining_include.php'; echo "$main"; } ----------------- As far as I know you can not do a Var = include. if you want to make a page show with in a var you may have to require_once( 'templates/'. $cur_template .'/index.php' ); { global $cur_template; include 'dining_include.php'; echo "$cur_template"; } Hope this helps. You may wanna check into something else to get a PHP page to echo. Brett
-
Can you post the code that is doing the call? Brett
-
Are you pulling Vars from the include PHP file? Post the include PHP code if you can. Brett
-
I would make it a CSV file separated by commas and then see if you can find something on adding it that way. Brett
-
Are you doing this with in PHP? Brett
-
You can also just add the include into your array. <?php function foo() { global $color; include 'vars.php'; echo "A $color $fruit"; } The thing with the "include" is once you added it to your PHP file it is automatically included anywhere you call for something that is in the include file. That also includes the Vars that are in the "include PHP file" that you call. Hope that helps, or makes sense. Brett
-
Don't forget to mark the post as Solved. Brett
-
If you are using version 5.1 here is what they have listed. http://dev.mysql.com/doc/refman/5.1/en/full-table.html Operating System File-size Limit Win32 w/ FAT/FAT32 2GB/4GB Win32 w/ NTFS 2TB (possibly larger) Linux 2.2-Intel 32-bit 2GB (LFS: 4GB) Linux 2.4+ (using ext3 filesystem) 4TB Solaris 9/10 16TB MacOS X w/ HFS+ 2TB NetWare w/NSS filesystem 8TB Brett
-
It looks like to me that you are not doing a mysql close connection after opening them. After you open the connection make sure to close the connection after running your SQL commands. Brett *EDIT* My bad did not read this to closely. up the limit You can change the variable from the command line, with: SET @MAX_QUESTIONS=<your new value>; For example: mysql> set @max_questions=0; Or you can open the my.cfn or my.ini and change the value there.