Jump to content

shocker-z

Members
  • Posts

    864
  • Joined

  • Last visited

About shocker-z

  • Birthday 01/22/1985

Profile Information

  • Gender
    Not Telling
  • Location
    Nottingham

shocker-z's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. <?php $check=mysql_query("SELECT * FROM table WHERE userid = '".$userid."' AND field IS NULL"); $count=mysql_num_rows($check); If ($count == 0) { $SQL = "INSERT into TABLE (field) VALUES ('{$_POST['value']}') WHERE userid = '$userid'" } else { $SQL = "UPDATE table SET value = VALUE ('{$_POST['newvalue']}') WHERE userid = '$userid'" } ?> untested and a bit rushed but give it a try Liam
  2. Oh he means a built in function, i know is .NET it's datagrid. Here you go http://www.phpgrid.com/grid/ Liam
  3. Yes it sounds like your on about AJAX I've used it in the past, can get quite complicated at times with multiple objects but it can produce some great sites! Liam
  4. Not so much insecure as just totaly pointless. I can understand a text message, but when access the internet to log into your email to send an email to receive an email with your balance when you could just log into the site and click balance. If you really want to go ahead with it then you would have to look into using a mailserver with a mysql database (or another accessable database) and search through the emails on some sort of cron job for emails with balance in the subject. I read up about phones and this can be done on linux system by connecting an old nokia phone by database and text messages are stored in a MySQL databae and you would search that. still which ever way as said it is insecure and the email side of it is more work then just logging into your site and clicking on balance. EDIT: l0ve2hat3 I did use some sence and guess you wasn't a bank. but it was kind of a bad example lol regards Liam
  5. An email to SQL?? Not really possible without running some kind of external process launch from outlook or somthing but even then you have to sent the email data to SQL. could you explain more of what your thinking please? regards Liam
  6. Congrats on the 100 posts, you get above 1000 and you start getting depressed about life and well Barand and that must be in an institute now! lol I think your looking for mod rewrite. Regards Liam
  7. how about creating a few different domains? Cheap enough and would do the trick if avalible. liam
  8. being as PHP is server-side i cant see that being possible. However you could look at using hosts instead of IP? $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); you could strip it down to local exchange but then you still have possibility of someone getting in who shouldn't. how sencitive is the data? Regards Liam
  9. It should still be erroring out to be honest as i missed the second usage of $_GET[''] Your final code should be <?php $dblink = mysql_connect("localhost","username", "password") or die('Error: '.mysql_error ()); mysql_select_db("database"); $result = mysql_query("select * from tablename where sku='".$_GET['sku']."'") or die('Error: '.mysql_error ()); $row = mysql_fetch_array($result); $link = $row['link']; mysql_query("update tablename set clicks=clicks+1 where sku='".$_GET['sku']."'"); header('Location: $link'); mysql_free_result($result); mysql_close($dblink); ?> Remember to put your code within code brakets (the hash symbol) as this makes it easier to read and diagnose. Regards Liam
  10. Try this mate <?php $dblink = mysql_connect("localhost","username", "password") or die('Error: '.mysql_error ()); mysql_select_db("database"); $result = mysql_query("select * from tablename where sku='".$_GET['sku']."'") or die('Error: '.mysql_error ()); $row = mysql_fetch_array($result); $link = $row["link"]; mysql_query("update tablename set clicks=clicks+1 where sku=''$_GET['sku']''"); header("Location: $link"); mysql_free_result($result); mysql_close($dblink); ?> change the $_GET so it's outside the "" Regards Liam
  11. I.m creating a dynamic query to pull out workbooks from my database the table structure is below. Table: curricworkbooks Columns: ID, curric, assessment, topic, workbook, filename Example data [iD] [curric] [assessment] [topic] [workbook] [filename] 1 N1/E1.1 Numeracy E1 Count 1 workbooks/Num Entry 1/Unit 1/04 N1E1.1-3 Worksheets Num.pdf 10 MSS1/E1.6 Numeracy E1 Capacity 13 workbooks/Num Entry 1/Unit 13/04 MSS1E1.6 Worksheets Num.pdf 100 MSS1/L1.7 Numeracy L1 Conversions 14 workbooks/Numeracy Level 1/wkbk_14 AoN L1 2D 3D & Scale.pdf So my system will output each workbook in a table which works fine. using thsi query SELECT distinct(curricworkbooks.filename),workbook FROM curricworkbooks WHERE assessment = 'Literacy E2' AND workbook IS NOT NULL ORDER BY workbook ASC but i need to also select the ID field from the table, so i thought the query would be somthing like this: SELECT distinct(curricworkbooks.filename),workbook, ID FROM curricworkbooks WHERE assessment = 'Literacy E2' AND workbook IS NOT NULL ORDER BY workbook ASC But when i use that query i get non distinct results. I need the distinct on filename as there can be multiple curriculum reference per each workbook which can relate to the same file (Trust me just beleive me on this on the structure is totaly unlogical but it's data that im unable to change.) All support greatlt appreciated. Posted simular to this yesterday but think the site got restored again. regards Liam
  12. Try echo instead of header just to see what your outputting. Liam
  13. Your ( was in the wrong place or a less i miss read? function freecontentrewrite_run($article_cont, $case_sensitive=false) { global $contentdictionary_dic; Regards Liam
  14. Hi, Brief: I have a database table with the following columns: ID, curric, assessment, topic, workbook and filename This table is used to pull out workbooks for certain assessment levels of the curriculum. What im trying to do is select all records from curricworkbooks table where the filename field is distinct and assessment = 'Literacy L1' My current query below. SELECT distinct(curricworkbooks.filename),workbook FROM curricworkbooks WHERE assessment = 'Literacy E2' AND workbook IS NOT NULL ORDER BY workbook ASC This works fine but i also need to pull out the ID yet when i change my query to: SELECT distinct(curricworkbooks.filename),workbook,ID FROM curricworkbooks WHERE assessment = 'Literacy E2' AND workbook IS NOT NULL ORDER BY workbook ASC It doesn't filter by distinct and therefore I end up with multiple results for the same workbook. The reason for the duplicate workbooks is that there are different curriculum references. Regards Liam
  15. have a look here at mysql reference for RAND() http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand It looks like it may do the job. SELECT * FROM quotation ORDER BY RAND() may work but i have not tested. Regards Liam
×
×
  • 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.