Jump to content

shedokan

Members
  • Posts

    224
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://shedokan.110mb.com/

Profile Information

  • Gender
    Male

shedokan's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. By what Mchl says, it's not the Sql query that's making it take so much memory but your table is probably very big.
  2. I'm not, you can clearly see from my first example that somehow colum3 got the table's name in the example and in the real query tokenmap got the name of the table which is: tokenize I have given all of the code which I used to test this, and the result values are not important since it's the column name that has a problem not the values returned.
  3. The actual query has a WHERE after it, but I tried removing the WHERE and it's still problematic:
  4. Supposing that all words end with a comma and start with a space you can get all rows that have a practicular word in them like so: $result = mysql_query("SELECT id, asset_lightboxes FROM table WHERE asset_lightboxes LIKE '% planes,%'"; Then you can loop through each of them, replace " planes," with "", and update while($r = mysql_fetch_row($r)){ $r['asset_lightboxes'] = str_replace(" planes,", '', $r['asset_lightboxes']); mysql_query("UPDATE table SET asset_lightboxes = '".$r['asset_lightboxes']."' WHERE id =".$r['id']); } Or you can join all update queries to a giant string with ; at the end of each and update them all at once, but that depends on your server. Hope I helped you.
  5. I have this code: $sql = 'select column1,column2,column3 from table;'; $result=$mysqli->query($sql) or die($mysqli->error); while($t = $result->fetch_assoc()){ print_r($t); } And what I get is this: Why did mysqli change column3 to table? what am I doing wrong? Thanks.
  6. what if someone hacked into someone's account and the real account owner changed the password? the account will be still logged in. He should check if the username and password are valid for each page.
  7. This has turned to be more than application design thread, ask for help in the help forum. you can also try some different tutorials on user login systems in php. I'm sorry I can't help you here.
  8. The problem is that you don't save the user's id or anything in the session, so people that are not logged in can view all pages. So that user can change the page from PC_asociados_update.php?id_E=1 to PC_asociados_update.php?id_E=2 manually and you will allow him. You need to save the user's id, username and password in the session and at the load of each page check it in the database.
  9. To add something to a php string you don't use echo you do: $MM_redirectLoginSuccess = "PC_main.php?id_E=".$row_Login['id_E']; the dot adds two strings together.
  10. N No that tutorial is not user-based, it logs by ip, and once an ip has not been logged on for more than 5 minutes(or whatever) then it removes it from the database, meaning that only ip's that have been activate in the last 5 minutes are marked as "online users".
  11. That depends on your login system, after the user logs in how do you keep him logged in? I mean once that the user logs in and you send him to another page how do you know he's already logged in and you don't have to send him to the login page?
  12. I know what you wrote, people that try do find out technical approaches search for similar works to what they need to accomplish and learn from them. if you want I can give you the techinical approach in words that that tutorial offers, but it's a critical skill for a programmer to have.
  13. There are already some simple tutorials that show you how to do it, eg: http://www.spoono.com/php/tutorials/tutorial.php?id=16
  14. it depends on your records, for example if you save a record as a row in the database then you can add a column with the user's id, like you have an adrress table: | firstname | lastname | | - - - - - - - | - - - - - - - - | | Joe | Something | | Jay | Family | Then you can add a column says the id of the user like: | uid | firstname | lastname | | - - -| - - - - - - - | - - - - - - - - | | 1 | Joe | Something | | 2 | Jay | Family | And then you know that Joe Something belongs to the user with the ID of 1 and in your user's table you have: | id | username | password | | - - -| - - - - - - - | - - - - - - - -| | 1 | user1 | ******* | | 2 | user2 | ******* | So when a user get's logged in you save the user's id in the session or cookie, and when a user trieds to access an address you check the uid of the address, like if user1 tries to access "Joe Family" you don't allow him because the uid on Joe Family is 2 and user1 has an id or 1. Did that help you?
×
×
  • 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.