Jump to content

Canman2005

Members
  • Posts

    669
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Canman2005's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. thanks all, managed to crack it, stupid mistake I made
  2. Hi I have a HTML form which posts to a PHP script. On the PHP script I have $_SESSION['mystuff'][] = array('idnumber'=>''.$_SESSION['myID'].'','titlename'=>''.$_POST['productname'].''); and basically this array builds up each time the form is submitted I then output this data using $num=0; foreach($_SESSION['mystuff'] as $mystuffvals) { print $_SESSION['mystuff'][$num]['titlename']; print "<br>" $num = $num+1; } this all works fine, but I want to be able to add a "delete" link next to each one so that it can be removed. how possible is that? I did try adding <a href="?remove=<?php print $num; ?> under the bit of code print $_SESSION['mystuff'][$num]['titlename']; and then running something at the top of the page which looks like if(isset($_GET['remove'])) { unset($_SESSION['mystuff'][$_GET['remove']]); } ?> but that seems to unset random arrays and I can't think what could be wrong. Please help Thanks J
  3. Hi all I was recently contacted by a friend who is having SPAM issues, basically someone has managed to upload tons of crap files and also inserted eval(base64_decode("ZXJyb3Jfcm..... about 10 times into every PHP page on the server, and doing a search reveals 1001 instances of this eval(base64_decode("ZXJyb3Jfcm..... code. How could this have happened and what measures do we need to take to prevent this?
  4. Sorry, I would say a SELECT query to grab the title, it's what I would use
  5. Wonder if someone can advise I have a script which runs on a CRON job, so every hour a script is activated. When the script runs, it INSERTS between 1 and 12 records into a database table, works a charm so far. When each QUERY is run on the script, it grabs the last ID number that was INSERTED and that is entered into another table, so if my script INSERTS a new row with an ID of 34877, then the ID number 34877 is entered into another database table. To grab the last ID number, I have always used $last_id = mysql_insert_id(); as seen on http://php.net/manual/en/function.mysql-insert-id.php which has always worked great. I now have to create another script on a CRON job, which does a similar TASK, it INSERTS a record into the same database and then grabs the last ID number. The plan is to roll about 150 of these script out, so each one is INSERTING data, and grabbing the last ID of the row just created. By 2015, they plan to have several thousand of these scripts, all being run at the same time. This is basically part of a bigger system and this is the method in which the 3rd party suppliers need data handled, so I have no option. My question is, if I have tons of scripts INSERTING data to the same database table and each time an INSERT is done, the last ID is grabbed, can PHP get overloaded and confused and then end up returning the wrong ID number of the row INSERTED. Or if I put $last_id = mysql_insert_id(); straight after each INSERT, then is it gurenteed that the right ID number is returned. Just concerned the QUERIES will end up in a que and incorrect ID numbers will be returned. Basically, is $last_id = mysql_insert_id(); flawless in getting the ID number of the row just INSERTED? Cheers everyone
  6. Hello all I wonder if someone can give me some advice, sorry if this is in the wrong place, I couldn't seem to find the right forum to put it in. I am helping a friend to build a PC support ticket system for use by around 100 support groups, 50 schools and 20 universities, over time a total potential student population of between 300,000 and 800,000 might use it. Of course they as not all going to be accessing the system at once, but of something major happens, there could be almost half the students submitting a ticket at once, but I want to build it in a way that it could cope with 1,000,000 users, I know server space maybe expensive and luckily I wont have to pickup the bill for that. So my questions are; [*]Can PHP handle this volume of traffic with multiple SELECTS, INSERTS etc [*]Can PHP ever crash due to overload or is it always the server which has the overload and crashes, if it's PHP, what can be done to stop that? [*]What would be the best way to hold user data? Is is best to spread the data over multiple tables [*]Is there anything I should consider in PHP when working out a viable system [*]Any advice on the type and level of server we should use I assume PHP would be the best to use as companies like Facebook seem to use PHP and they handle 500 millions users, so I guess it's stable enough. I guess Cloud hosting would be best to balance the load?? I was going to code this all myself over time and learn advanced PHP a bit more, is this a good idea or should I be learning using a framework like ZEND or something like Drupal? Thanks all
  7. Thanks Ken So if I don't use a WHERE clause, is there any way in which to get it to do something like a "loop". and go through each row and update with a different random code? Thanks
  8. Hi all I have the following simple code mysql_query("UPDATE `people` SET `access` = '".rand(11111,99999)."'"); But at the moment each row gets the same "rand()" code, is there anyway to assign each row a different "rand()"? Thanks
  9. thanks, that seemed to work great Just another question, but is it also possible to add something like that at the end of the QUERY, so adding JOIN t.things ON t.userid = p.id to the end of SELECT p.id, p.name, p.topic FROM people p WHERE p.type = 'Math'; so I guess it would be something like SELECT p.id, p.name, p.topic FROM people p (p.topic = 'yesterday', JOIN t.things ON t.userid = p.id) WHERE p.type = 'Math'; Thanks very much
  10. Hi all I wonder if someone can help. Is it possible to add an "if" statement into a QUERY? For example, I have SELECT p.id, p.name, p.topic FROM people p WHERE p.type = 'Math'; But I want to add if(p.topic == 'today') { p.date } to the end of SELECT p.id, p.name, p.topic so it would look something like SELECT p.id, p.name, p.topic, if(p.topic == 'today') { p.date } FROM people p WHERE p.type = 'Math'; So in real terms it would end up looking like either SELECT p.id, p.name, p.topic FROM people p WHERE p.type = 'Math'; or if topic equaled "today" then it would use SELECT p.id, p.name, p.topic,p.date FROM people p WHERE p.type = 'Math'; I know the above is not possible, but what would I change it to if at all possible. Thanks all Ed
×
×
  • 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.