Jump to content

runthis

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by runthis

  1. bumpity bumpity bump bump bump
  2. <a href=?del=1>1 name1 email1</a> <a href=?del=2>2 name2 email2</a> <a href=?del=3>3 name3 email3</a> if(isset($_GET['del'])){ mysql_query("DELETE FROM tablename WHERE id='{$_GET['del']}'"); } if its for something like user accounts, make a field named 'active' and if its being deleted, don't actually delete it, set active to 0 and on your pages you can have a simple little if($active == '0'){ print "This account is inactive"; die; } in your header
  3. bumb
  4. Ok i just read your first post but i get the jist of it You want to edit something thats bieng fetched from an array, easy Look up Ajax inplace editor assign a specific key to each result for example $query("stuff"); $id="0"; while($result=mysql_fetch_array($query)){ $id=++; print "<a href=edit.php?id={$id} onClick=(AJAX STUFF HERE)>{$result['field']}</a>"; } would output <a href=edit.php?id=1 <a href=edit.php?id=2 <a href=edit.php?id=3 <a href=edit.php?id=4 etc. When you set the ajax inplace editor to the links it uses the specific $id to edit just the one you click and sends it to another file for updating without the page changing, hope this helps at all
  5. Im not new to php at all, but havent had the need to use preg_match I want to get all the links off of a page, but i want the href, not the class or title or anything heres what i have to get the links <a\s[^>]*href=(\"??)(\/stuff[^\" >]*?)\\1[^>]*>(.*)<\/a> that matches any link that starts with /stuff
  6. Im not new to php at all, but havent had the need to use preg_match I want to get all the links off of a page, but i want the href, not the class or title or anything heres what i have to get the links <a\s[^>]*href=(\"??)(\/stuff[^\" >]*?)\\1[^>]*>(.*)<\/a> that matches any link that starts with /stuff
  7. Got it on the first post.
  8. Nevermind i didnt see your setback idea as well, im gonna try it then hit solved
  9. i was hoping for a fancier way than putting an if statement in my loop Lets say i display 20 items and the last 2 are off the page, ok i set my if statement to 18 and throw in the <tr></tr> to display the next 2 underneath that means if i want the user to display 56 things i have to code if 18 <tr></tr> if 36<tr></tr> Thats bad coding, is there a better way?
  10. Your first code connects to your database, your second code selects (*=anything) from your listed table (users) the way it would work is this dbconnect.php <? $con = mysql_connect("localhost","virtu857_system","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("virtu857_system", $con); ?> index.php <? include 'dbconnect.php'; $query = mysql_query("SELECT * FROM Users") or die("Error: " . mysql_error()); $result=mysql_fetch_array($query); print "{$result['field']} < I displayed that field"; blah blah blah ?> Notice i just included the page into my index.php
  11. When im displaying a list of data horizontally it overflows out of the table, doing overflow:hidden in css only hides what i want to display, how do i get the data to just jump one line down when its reached the maximum width i allow
  12. Heh. Possible?
  13. Works like a charm, thanks for making me feel dumb RESOLVED
  14. i feel dumb for not thinking of that first, lemme give it a go
  15. I had a same problem, you have something wrong in your actual database, for instance if i a have a field in my structure that is an INT and i try to update it with "pickleeater" it wont tell me there is an error, it just wont go, try changing your field types to match your inserts bro.
  16. i have a primary key set to auto increment but thats for the id not for the field i want to update, let me try to give you a better understanding DATABASE IDNameField2update 234john1 235john2 236john3 if i deleted id:235 it would look like IDNameField2update 234john1 236john3 I want to reorder 'john' to look like IDNameField2update 234john1 236john2 Where im changing the 'Field2update'
  17. My problem is, i want to update the database by renumbering all fields, heres what i got $unique $q=mysql_query("SELECT * FROM table WHERE something='$unique'"); $p=0; while($r=mysql_fetch_array($q)){ $p++; print $p; mysql_query("UPDATE table SET field='$p' WHERE something='$unique'"); } Obviously this script creates a loop where 'field' gets updated as many times as there are rows and ends up updating all 'field's to the same value What i want it to do is update each field to reorder that field so if the fields in order were 1,2,5,6 it would change them to 1,2,3,4.
×
×
  • 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.