Jump to content

intodesi

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by intodesi

  1. Very Cool thank you very much for the example, I can see how what I want to do needs to be done, i didnt know about the "ORDER BY RAND()" string. Thanks again, I will post back as soon as I am able to get it tested.
  2. Hello, What I am trying to do is get semi random data from a MySql table. I have a database named kidpatrol, which has 4 tables under it, kids, parents, cards, and tracking. The first thing in my project that I would like to complete, would be figuring out how to grab a semi random row from the cards table, based on user selection and past events. in the cards table, there are 4 rows, card_id, card_diff, card_name, card_text. card_diff is for card difficulty, what i need to be able to do is when I display a choice of three difficulties (which i can do) and when that specific difficulty is chosen a random card is displayed, if that card has not been displayed before. so my script has to be able to 1) Get a random card based on difficulty. 2) Make sure that the Card has not been used before a) Using the tracking table to accomplish this. Tracking table has three rows. kid_id, card_id, and date. Any help would be great, basically I gave a whole bunch of info, but all i need to do is figured out how to grab the data from the cards table randomly after the kid selects difficulty, and then make sure that the specific card has not been used. Thanks
  3. I am writting ( attempting ) a small app and in the app I need to talk to a mysql db So I have 4 fields for user input server ip dbname dbuname dbpass and two buttons test connection and connect I am using this code for my Test Connection Button Dim conn As New MySql.Data.MySqlClient.MySqlConnection Dim myConnectionString As String myConnectionString = "server=192.168.4.3;" _ & "uid=root;" _ & "pwd=d3dikatian;" _ & "database=eq2server;" Try conn.ConnectionString = myConnectionString conn.Open() Catch ex As MySql.Data.MySqlClient.MySqlException MessageBox.Show(ex.Message) End Try But when I debug and hit the button it says cant connect to 192.168.4.1 but in the code I am not trying to connect to 192.168.4.1, I am trying to connect to 192.168.4.3 So what I am thinking is the code or connector.. isnt trying to connect to the remote mysql.. so I am lost.. Any help would be apreciated
  4. I would like to add http://www.hostony.com can I post my affiliate link ?
  5. Your's looks cool.. I havnt seen AVP yet, guess i should.. looks good
  6. took me about three hours not counting the 2 hours+ of research time figuring out premieire cs3 Let me know what you think
  7. Yeah, as soon as I can get the significant other to do it
  8. Wow, I really must thank you Barand.. I dropped that table, and used the sql you last posted, and all is well.. but i dont understand why i could make PRIMARY KEY (`uid`,`project_id`) from the table i already had... but anyways, thank you nm I see how now its what i get for using phpmyadmin i need to look for the right stuff to do
  9. So this is the table data I get INSERT INTO `projects` VALUES(0, 1, 'Test', 'whatever', 'Finished', 'none', 'ferret.jpg', 'cat.jpg', '0000-00-00 00:00:00'); INSERT INTO `projects` VALUES(3, 2, 'Test', 'teast', 'test', 'test', 'test', 'test', '2008-05-25 00:00:00'); so "0" and "3" are uid's and the second numbers are the project_id's which are auto incrementing, but not starting over for each uid
  10. so my primary key looks like this PRIMARY KEY (`project_id`) not PRIMARY KEY (uid, project_number)
  11. kk and Barand, I dont think i can make two primary keys in the same table? I get a sql error? and how do i move a row up in a table thats already been completed? from what you showed me on how my rows should be, project_id being second, how can i move that down without recreating the table?
  12. well in the client table uid needs to auto increment, I will show my client table CREATE TABLE `clients` ( `uid` mediumint( unsigned NOT NULL auto_increment, `f_name` varchar(60) NOT NULL, `l_name` varchar(60) NOT NULL, `c_name` varchar(60) NOT NULL, `email` varchar(60) NOT NULL, `phone` varchar(60) NOT NULL, `u_name` varchar(60) NOT NULL, `u_pass` varchar(60) NOT NULL, `client_url` varchar(60) NOT NULL, `last_login` datetime NOT NULL default '0000-00-00 00:00:00', `activated` enum('1','0') NOT NULL default '0', PRIMARY KEY (`uid`), UNIQUE KEY `u_name` (`u_name`), UNIQUE KEY `client_url` (`client_url`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; and this is my projects table CREATE TABLE `projects` ( `project_id` mediumint( unsigned NOT NULL auto_increment, `uid` mediumint(9) NOT NULL, `project` varchar(60) NOT NULL, `description` text NOT NULL, `status` varchar(60) NOT NULL, `file_loc` varchar(60) NOT NULL, `invoice` varchar(120) NOT NULL, `proof` varchar(120) NOT NULL, `l_update` datetime NOT NULL default '0000-00-00 00:00:00', UNIQUE KEY `project_id` (`project_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  13. ok the IE bug on the contact page is fixed, in IE all width's etc have to be defined for each row/column in a table, while in FF, only the width on the first row/column needs to be defined.. FF makes for slack coding.. makes you lazy i guess
  14. Yeah IE always screws me.. I can fix that though. whats weird is that contact form is in a table of its own, so not sure why its offset.... IE just likes to be difficult easy fix though i think. and padding is fixed, I will have to go through all my pages to check for compatibility issues I am assuming, thats ok though. and thanks for everyones input I am a horrible designer i just like code... and my GF is the hraphics artists.. so its hard to get her to do things right hehe..
  15. yeah project_id is a row as well as uid, the table is projects, i want project_id to auto increment based on each uid, which doesnt auto increment in the project table, uid is part of my clients table, which auto increments there. so each client gets a uid that auto increments in the client table, then in the projects table uid links each project to a customer. but i want each customers project to auto increment starting from 1, its not a nescessary application in my database, most likley its useless, but i would still ike to know if its possible
  16. Assuming what I am asking is not possible then?
  17. GuiltyGear I made updates to the page, and lightened the center background image a tad bit. Let me know if you would
  18. ah, i see, i should have know better hehe.. well i got this to work also $type = $_GET['type']; $id = $_GET['id']; $sql2 = "SELECT * FROM projects WHERE project_id='$id' LIMIT 1"; $result2 = mysql_query($sql2); $image = mysql_fetch_assoc($result2); echo ("" .$type ." for ".$image[project].""); echo ("<br />"); echo ("<img src='clients/clients/$type/$image[$type]' />"); ?> replacing $type with just an *, but I am going to plug what you suggested in also, because thats the route i would like to take
  19. OK ive decided not to store the images in a database, so I am just using the database to store the file name. I am using this code $type = $_GET['type']; $id = $_GET['id']; $sql = "SELECT '$type' FROM projects WHERE project_id='$id' LIMIT 1"; $result = mysql_query($sql); $image = mysql_result($result); echo ("<img src='/$type/$image/' />"); echo $image; echo $type; ?> but that doesn't seem to be working, i am using the echo $image and echo $type to see if the variables are being passed and they are except the echo $image is displaying the variable from $type, not sure whats going on.. also, i have it set so that $type is also the folder so that img src="$type works, so i dont think the rpoblem is there
  20. Is it possible to have a unique row that does not auto increment, that has a relationship to another table say for example i have a clients table and a projects table uid in the clients table auto increments and is unique and then uid in projects table is unqiue while also having a project_id row that auto increments based on uid so table projects row's uid = unique project id auto increment (starting from 1 for each uid) uid = 1 project_id = 1 project_id = 2 project_id = 3 project_id = 4 and so on then uid = 2 project_id = 1 project_id = 2 project_id = 3 project_id = 4 and so on
  21. Still Getting an error line 60 code Code and if it helps echo ("<td><a href='index.php?c=clients&proof=$row[project_id]&type=proof'>Proof Available Click Here</a></td>"); all fields are getting passed properly
  22. Scratch this should have been $result2 Getting an Error Line 60 is echo mysql_result($result_2);
  23. OK, does anyone see any problems with the following, and where I have the blue text below, what syntax would I use to achieve that statement? <?php $type = $_GET['type']; if ($_GET['proof']) { $project = mysql_real_escape_string($_GET['proof']); } elseif ($_GET['invoice']) { $project = mysql_real_escape_string($_GET['invoice']); } else { [color=blue]"If neither of the above are present i want this to do nothing"[/color] } $image = "SELECT '$type' FROM pages WHERE project_id='$project' LIMIT 1"; $result2 = mysql_query($image); header("Content-type: image/jpeg"); echo mysql_result($result_2, 0); ?>
  24. i use PHP to include google.com on my intranet web page. not sure if that works proficiently, but for what i do at home its great..
  25. not my question, but still looked at the dreamhost service, and for the content you linked, an invitation is required, and they are below par what my current hosting provides.. still about my first host, is 195 bucks a month worth what they are offering?
×
×
  • 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.