-
Posts
279 -
Joined
-
Last visited
Never
Posts posted by vicodin
-
-
Well you should not be using PHP4. You should be using atleast 5... You may be using some code which is not compatible with PHP4. upgrade to PHP5 and see if it fixes your issue.
-
Your gonna have to utilize AJAX for this... Google "AJAX and PHP Tutorial"
-
Here is an example of my DB connect class.
Class DBConnect{ var $user = 'username'; var $pass = 'password'; var $db = 'mydb'; var $server = 'localhost'; Private Function setServer($server){ $this->server = $server; } Function setUser($user){ $this->user = $user; } Function setPass($pass){ $this->pass = $pass; } Function setDb($db){ $this->db = $db; } Function openCon(){ mysql_connect($this->server,$this->user,$this->pass); mysql_selectdb($this->db); } } #End Class ?>
It would be used like this.
$con = new DBConnect(); $con->openCon();
If I need to change any of the settings you can use the set Functions like this.
$con = new DBConnect(); $con->setServer("Host2") $con->setUser("User2"); $con->setPass("Pass2"); $con->setDb("DB2"); $con->openCon();
-
Your not way way off like this guy just said, but your off.... I haven't tested the other class's in your code but you def not utilizing your own method correctly.
Change this:
$login = new login(); $login->loginAction = $_POST["username"]; $login->loginAction = $_POST["password"]; $login->loginAction = 1;
To this:
$login = new login(); $login->loginAction($_POST["username"],$_POST["password"],1);
Also your DB Connection Class is way way over kill. Your jumping all around you class when you could get everything done on a few functions.
-
When displaying the characters use htmlentities(). If you don't like using that then you need use something other than UTF-8, try ISO-8859-1.
-
Not bad, the only problem is there's a ton of web sites that already do this, the biggest of course, Ebay... Honestly you should not be charging for access when you first start up... build a user base first and then charge.
-
Try this:
$sql = "UPDATE about SET titleus = '{$uptitle}', aboutus = '{$upnews}' WHERE id = '1'";
-
I would defintly create a VPN just for security reasons and then setup the database to replicate to each other so you can have all the info local instead of sending them to the other database.
-
First and foremost you need to be more careful when creating any type of form that will be inserting info into the DB. As your code stands right now I could sql inject into your database and do whatever I want.
Change it to this...
$upid = mysql_real_escape_string($_POST[idf]); $uptitle = mysql_real_escape_string($_POST[title]); $upnews = mysql_real_escape_string($_POST[news]); $upimage = mysql_real_escape_string($_FILES['userfile']['name']);
We need to find out if theres an error going on in mysql. Change this: mysql_query($sql);
To:
mysql_query($sql) or die (mysql_error());
-
I just want to say the original replay to this thread was great! Very thorough and well thought out reply. Also on the basis of HipHop, HipHop is only effective in a high bandwidth, multi-server environment. You will actually lose performance in a single server install.
-
I thought the same way as you when I had procedural programing down pat but was not very skilled in OOP. I put off mastering OOP for a long time and now I realize that was a mistake. I write anything that's gonna be over 30 lines in OOP now. In the end it becomes so much more manageable to update and I can stop working on it for months and when I come back to work on it im not spending hours of time wondering where i left off. The extra time it takes to code in OOP for you will be well worth the experience and headaches down the road.
-
Download these tools and make sure you can connect to your database using them.
http://dev.mysql.com/downloads/gui-tools/5.0.html
Make sure the MySQL service is running as well.
-
You need to post the exact MySQL error your getting.
-
Google MySQL Clustering.
-
Your making that alot harder than it needs to be. You don't need so many tables. I would get rid of the entire anonymous tables and put a field into the user section named "is_anon" and I would assign either a 1 or a 0 to indicate True or False.
-
Jack you will need to use a program that can query a mysql database like this:
http://dev.mysql.com/doc/query-browser/en/
If you want to show the information on a website then you will need to learn a server side programming language like PHP.
-
You can make a default value for a field if nothing is inserted into it.
http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html
-
What OS? If its windows then just go into Add/Remove program and modify it to include it. Honestly just google how to add modules in the PHP.ini file. You will get you answer faster.
-
You just did... If its not working then its a permission issue on your server.
-
As far as JQuery I couldn't tell ya but here is a great example of how PHP uses check Boxes.
http://www.computing.net/answers/webdevel/php-amp-checkboxes/1122.html
-
Can you please go into detail of what is not happening that you want to happen?
-
I really dont know of a good way to do this... what i would do is convert it to a unix time stamp and then find out how much each timezone is off from my current time zone. So like if my current time of my server is 1300103485 and i know the next timezone over is an hour less so 1 hour converted to seconds is 3600 seconds. 1300103485 - 3600 = 1300099885. That converts from unix time stamp to: Mon, 14 Mar 2011 10:51:25 GMT. There is probably a more effective way to do it but thats all I got.
-
Hey, So what im trying to do is put my database variables into a session array. So this is what im trying to accomplish...
$_SESSION['Name_of_Row'] = $value
This is the script I wrote:
Function setupSession(){ session_start(); $query = "SELECT * FROM users WHERE u_id ='{$this->u_id}'"; $result = mysql_query($query); $row = mysql_fetch_array($result); foreach($row as $key => $value){ if(!empty($value)){ $_SESSION[$key] = $value; } } }
When that runs I get the following warning. Can anyone tell me what this means and how to fix it?
Error: Notice: Unknown: Skipping numeric key 0 in Unknown on line 0
-
It all depends on how many people are going to be accessing it at once. There are online hosting services that are like $5-$10 a month that will probably only give you access to a couple hundered people at once. Then you have ones that are $20-$40 a month that will allow you to server a couple thousand people at once. If your gonna go with a hosting company and your own server than expect to pay $1000 for a decent server and than about $100 a month in hosting fees(If your gonna have the DB on the same server than increase the RAM). As for the speed of your site, that depends on how well you coded it. The more you can do in the least amount of instructions the faster it will be. From what it sounds like you wont be doing anything to crazy so i wouldn't worry about that. As for security just make sure you validate every input and output, I work in a school distict and kids love to google things and try them out on your site and see if they can break it.
PHP mysql Pagination
in PHP Coding Help
Posted
I would love to help you but I am having trouble understanding what your problem is. Also your code is not very readable. Can you please name your variables to something relevant so everyone knows exactly what that variable is... and also please tab your code correctly so its more readable.