Jump to content

bubblegum.anarchy

Members
  • Posts

    526
  • Joined

  • Last visited

    Never

Everything posted by bubblegum.anarchy

  1. SELECT * FROM table WHERE ( name LIKE '%$search%' OR desci LIKE '%$search%' ) AND trim('$' FROM price) < 20
  2. Consider this: $result = mysql_query($query = sprintf(" INSERT INTO checkbook_users (id, name, email, password) VALUES (NULL, '%s', '%s', md5('%s'))" , mysql_real_escape_string($register_name) , mysql_real_escape_string($register_email) , mysql_real_escape_string($register_pw))) or trigger_error(mysql_error()."<PRE>".$query."</PRE>", E_USER_ERROR);
  3. How are you determining which of the records other columns information should be displayed with the unique description?
  4. SELECT idquestion, count(idquestion) AS counter FROM answers GROUP BY idquestions ORDER BY counter DESC
  5. The problem is: FROM `tbl_link` = l, `tbl_payment` = p should be: FROM `tbl_link` AS l, `tbl_payment` AS p
  6. Try something like this: $query = " INSERT INTO`creature_template` ( `entry`, `modelid_m`, `modelid_f`, `name`, `subname`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction`, `npcflag`, `speed`, `rank`, `mindmg`, `maxdmg`, `attackpower`, `baseattacktime`, `rangeattacktime`, `flags`, `dynamicflags`, `size`, `family`, `bounding_radius`, `trainer_type`, `trainer_spell`, `class`, `race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `combat_reach`, `type`, `civilian`, `flag1`, `equipmodel1`, `equipmodel2`, `equipmodel3`, `equipinfo1`, `equipinfo2`, `equipinfo3`, `equipslot1`, `equipslot2`, `equipslot3`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `ScriptName` ) VALUES ( '".mysql_real_escape_string($_POST['txtEntry'])."', '".mysql_real_escape_string($_POST['txtmodelid_m'])."', '".mysql_real_escape_string($_POST['txtmodelid_f'])."', '".mysql_real_escape_string($_POST['txtname'])."', '".mysql_real_escape_string($_POST['txtsubname'])."', '".mysql_real_escape_string($_POST['txtminlevel'])."', '".mysql_real_escape_string($_POST['txtmaxlevel'])."', '".mysql_real_escape_string($_POST['txtminhealth'])."', '".mysql_real_escape_string($_POST['txtmaxhealth'])."', '".mysql_real_escape_string($_POST['txtminmana'])."', '".mysql_real_escape_string($_POST['txtmaxmana'])."', '".mysql_real_escape_string($_POST['txtarmor'])."', '".mysql_real_escape_string($_POST['txtfaction'])."', '".mysql_real_escape_string($_POST['txtnpcflag'])."', '".mysql_real_escape_string($_POST['txtspeed'])."', '".mysql_real_escape_string($_POST['txtrank'])."', '".mysql_real_escape_string($_POST['txtmindmg'])."', '".mysql_real_escape_string($_POST['txtmaxdmg'])."', '".mysql_real_escape_string($_POST['txtattackpower'])."', '".mysql_real_escape_string($_POST['txtbaseattacktime'])."', '".mysql_real_escape_string($_POST['txtrangeattacktime'])."', '".mysql_real_escape_string($_POST['txtflags'])."', '".mysql_real_escape_string($_POST['txtdynamicflags'])."', '".mysql_real_escape_string($_POST['txtsize'])."', '".mysql_real_escape_string($_POST['txtfamily'])."', '".mysql_real_escape_string($_POST['txtbounding_radius'])."', '".mysql_real_escape_string($_POST['txttrainer_type'])."', '".mysql_real_escape_string($_POST['txttrainer_spell'])."', '".mysql_real_escape_string($_POST['txtclass'])."', '".mysql_real_escape_string($_POST['txtrace'])."', '".mysql_real_escape_string($_POST['txtminrangedmg'])."', '".mysql_real_escape_string($_POST['txtmaxrangedmg'])."', '".mysql_real_escape_string($_POST['txtrangedattackpower'])."', '".mysql_real_escape_string($_POST['txtcombat_reach'])."', '".mysql_real_escape_string($_POST['txttype'])."', '".mysql_real_escape_string($_POST['txtcivilian'])."', '".mysql_real_escape_string($_POST['txtflag1'])."', '".mysql_real_escape_string($_POST['txtequipmodel1'])."', '".mysql_real_escape_string($_POST['txtequipmodel2'])."', '".mysql_real_escape_string($_POST['txtequipmodel3'])."', '".mysql_real_escape_string($_POST['txtequipinfo1'])."', '".mysql_real_escape_string($_POST['txtequipinfo2'])."', '".mysql_real_escape_string($_POST['txtequipinfo3'])."', '".mysql_real_escape_string($_POST['txtequipslot1'])."', '".mysql_real_escape_string($_POST['txtequipslot2'])."', '".mysql_real_escape_string($_POST['txtequipslot3'])."', '".mysql_real_escape_string($_POST['txtlootid'])."', '".mysql_real_escape_string($_POST['txtpickpocketloot'])."', '".mysql_real_escape_string($_POST['txtskinloot'])."', '".mysql_real_escape_string($_POST['txtresistance1'])."', '".mysql_real_escape_string($_POST['txtresistance2'])."', '".mysql_real_escape_string($_POST['txtresistance3'])."', '".mysql_real_escape_string($_POST['txtresistance4'])."', '".mysql_real_escape_string($_POST['txtresistance5'])."', '".mysql_real_escape_string($_POST['txtresistance6'])."', '".mysql_real_escape_string($_POST['txtspell1'])."', '".mysql_real_escape_string($_POST['txtspell2'])."', '".mysql_real_escape_string($_POST['txtspell3'])."', '".mysql_real_escape_string($_POST['txtspell4'])."', '".mysql_real_escape_string($_POST['txtmingold'])."', '".mysql_real_escape_string($_POST['txtmaxgold'])."', '".mysql_real_escape_string($_POST['txtAIName'])."', '".mysql_real_escape_string($_POST['txtMovementType'])."', '".mysql_real_escape_string($_POST['txtInhabitType'])."', '".mysql_real_escape_string($_POST['txtScriptName'])."' )";
  7. SELECT * FROM files WHERE active_music [code] assuming that active_music is going to be either 1 or ( 0 or null ) [/code]
  8. To order by the start date: ORDER BY Cottage, str_to_date(substring_index(Dates, '-', 1), '%c/%e/%Y'); To order by the end date: ORDER BY Cottage, str_to_date(substring_index(Dates, '-', -1), '%c/%e/%Y');
  9. Syntax looks right, only other thing I can think of without looking at documentation is add -p for password. C:\Sokkit\mysql\bin\mysql -u root -p mydb < C:\Sokkit\mysql\bin\mydb.dump
  10. post the mysql code please... not the php the mysql code that is sent to the mysql server for processing.
  11. Define the id as an auto_increment CREATE TABLE repository ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'unique record identifier', value TEXT NULL DEFAULT NULL COMMENT 'repository value', primary_key (id) );
  12. Look, my apologies for not being helpful - maybe another forumer will be more so.
  13. SELECT * FROM topics ORDER BY replies / timestampdiff(SECOND, date, CURRENT_TIMESTAMP) timestampdiff >= mysql.version() v5.0.0
  14. see this bit of code (the problem code): $action = $_GET['action']; switch($action) { case 'read' : $sql = "SELECT * FROM '$table' where titleID = '$titleID'"; $allComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); $numallComments = mysql_num_rows($allComments); add this line: print '<PRE style="text-align:left;">'; print_r($sql); die("<P>Script Halted...</P>"); print '</PRE>'; so your code looks like this: $action = $_GET['action']; switch($action) { case 'read' : $sql = "SELECT * FROM '$table' where titleID = '$titleID'"; print '<PRE style="text-align:left;">'; print_r($sql); die("<P>Script Halted...</P>"); print '</PRE>'; $allComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error()); $numallComments = mysql_num_rows($allComments); and post the string stored in $sql... this is my first reply request.
  15. Try the fully qualified path: C:\Sokkit\mysql\bin\mysql -u root mydb < C:\Sokkit\mysql\bin\mydb.dump
  16. Some tables have a date_created column defined as a timestamp or datetime - I suggest that you add a simliar column if one does not already exists to the table in question. Then you can check the current timestamp against the stored value when updating the record, the final fail safe query would look something like this: UPDATE repository SET item = {$value} WHERE id = {$id} AND date_created > CURRENT_TIMESTAMP - INTERVAL 10 MINUTES
  17. I mean - what error do you get when using md5() ?
  18. *slaps head* - yes of course btherl SELECT count(*) AS total_count , sum(IF (active = 'Y', 1, 0)) AS total_active , sum(IF (active = 'N', 1, 0)) AS total_inactive FROM card_number;
  19. Probably not quite what you are asking for but: SELECT ( SELECT count(card_number) FROM user_cards ) AS card_number_total, ( SELECT count(card_number) FROM user_cards WHERE active = 'Y' ) AS card_number_active, ( SELECT count(card_number) FROM user_cards WHERE active = 'N' ) AS card_number_inactive
×
×
  • 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.