Jump to content

s2day

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

s2day's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I have an array: [code]Array ( [0] => 122431206 [1] => 122431200 [2] => 210998761 [3] => 122431203 ) [/code] Now, I want to write a select query that would not select a row when a particular field's value equals any of those in the array above: ($ssna is the array) [code] mysql_query("SELECT * FROM `_population` WHERE `school_id`='$sch' OR `work_id`='$wor' OR `residence_id`='$res'  HAVING `ssn`!='$ssna' ORDER BY `lname` ASC") or die(mysql_error());[/code] The above query gives results which include rows containing the values in the array... how can I make the query not select the rows corresponding to the array values? Thank you.
  2. updateinfo.php can be something like this: [code] <? //mysql query calling for the data you want to be updated to fill in the values in the form below ?> <form name="update" action="process.php" method="post"> Field Name : <input type="text" name="field_name" value="<? echo $row->field_value;?>"> Field Name1 : <input type="text" name="field_name1" value="<? echo $row->field_value1;?>"> Field Name2 : <input type="text" name="field_name2" value="<? echo $row->field_value2;?>"> </form> [/code] on the process.php page, something like this: [code] <? if ($_POST['field_name']){ mysql_query("UPDATE `tablename` SET `field_name`='$_POST[field_name]', `field_name1`='$_POST[field_name]1', `field_name2`='$_POST[field_name2]'") or die (mysql_error()); echo "fields updated!"; ?> [/code] again, this is very basic..it bypasses other common and useful things you may want to use like check for blank/invalid entries, strip any tags someone may enter into a form field, check for duplicates (like duplicate username or email if that is what's updated), etc etc.
  3. hi, try something like this -pass id ($row['alias']) into a string; e.g. <a href="viewdetails.php?id=<?=$row['alias'];?>">click here for details</a> -on the details page, in this case viewdetails.php, you will grab the id in the url and use it in a mysql query to pull whatever details you need from the db, e.g. $sql=mysql_query("SELECT * FROM `table_name` WHERE `id`='$_GET[id]'") or die (mysql_error()); let me know if this works.
  4. hi, i am trying to obtain certain metadata from remote audio files..wondering if there is a way for php to parse that data.. for example, if a user types in a url, [a href=\"http://www.somesite.com/audio/cool.mp3\" target=\"_blank\"]http://www.somesite.com/audio/cool.mp3[/a], then i would like to be able to grab info pertaining to the duration of the audio and any other included info such as artist name, etc. thank 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.