Jump to content

floridaflatlander

Members
  • Posts

    671
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by floridaflatlander

  1. How far did you have to move it to get it to your property?
  2. Campfire type talk here. I was reading about keeping your queries to a minimum and it got me to thinking about how a file.php that I have has six queries 1. I have a query to see if a person is a member, if so provide a link 2. A sql query that makes a list of states to select 3. A sql query that makes a list of categories to select 4. A sql query to display a table with selected info from above 5. A sql query for titles 6. A sql query for photo links that are in another db. 7. An my right column is blank but will probably have queries in the future. Just wondering Thanks S
  3. I have database that is a list of categories that I would like to insert into a switch statement. This is the only way that I know how to do it right off hand and of course it doesn't work. I've looked on the internet and found examples but they are slightly over my head as ways to do it. Depending on $group which comes from the url a title an h1 would be assigned. $q = "SELECT * FROM categories"; $r = @mysqli_query ($dbc, $q); switch ($group) { if ($r) { //If $r ran OK while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){ case '$row['id_cat']': $h1 = '.$row['group']'; break; } } } Thanks S
  4. ALTER TABLE table-name ADD COLUMN id auto_increment MEDIUMINT(10) BEFORE name You'll have to play with it, adding an auto_increment column to a table with existing data, hmm I don't know. One time I wanted to add a not null column and I couldn't do it, I had to add the column, insert something into the column, then I renamed it not null. You may have to do something like that too.
  5. Multiple like $dbc1, $dbc2 or Multiple as in 2 or 3 people using $dbc at a time ? Use mysql_insert_id($dbc); ?
  6. I was looking at this and will be looking at it again in a month or two. For some reason when I was playing with it I couldn't get mysql_insert_id() to work and yes it was after the insert query. But I am going to try again later. I was also reading the info on php.net and someone used a select statement right after the insert that had where name = 'xxx' and this = 'tttt' and time = '$time' with time, name & this being the same as used in the insert. That looks promising. Anyway, but what are the odds that someone would place a record at the fraction of a second that you do when using mysql_insert_id(), especially if you use it right after the insert.
  7. Yes I saw that and to me Means that \n should be \\n and ' should be \' in my database. Anyway as long as it works. Thanks to everyone
  8. Thanks for the reply I must be doing something wrong because I don't see any difference in the database at all.. If is use ' OR ' or <img src="images/10_bass_031611-2_2242.jpg" /> <?php echo 'me'; ?> '' OR ''='' \n People will be entering text in this area of a table so strip_tags would get rid of photos and stuff like that. But does that still leave stuff like sql injection problems when I don't see any difference in stuff like ''OR''='' and ' OR ' Thanks
  9. Thanks for the reply. True mysqli_real_escape_string($db, trim($discrip)); does nothing while $discrip = mysqli_real_escape_string($db, trim($discrip)); lets info be entered. What does mysqli_real_escape_string() do ? I've been using UPDATE and mysqli_real_escape_string() to edit records with <img src="images/10_bass_031611-2_2242.jpg" /> <?php echo 'me'; ?> '' OR ''='' \n and all of it seems to go in my database just like I enter it. Thanks
  10. You could just use a table and sort any way you like if there aren't to many. Or use something simple in your sql like like. LIKE '%$first-name%' or something like that.
  11. What kind of phone directory do you have?
  12. I was checking my inputs and found out my mysql_real_escape_string() wasn't working and how little I new about mysql_real_escape_string(). Is mysql_real_escape_string() just suppose to add slashes ex from this ( ' ) to this ( \' ) ? or is it suppose to be more disruptive? Also what format should it be in ? When I have this, everything goes to my database and when I add ''Or''='' I can mess up stuff in my form display // $discrip = ($_POST ['discrip']); $discrip = mysqli_real_escape_string($db, trim($discrip)); When I have this It seems to work but takes everything out not leaving \'\'OR\'\'==\'\' So if I put 1 <img src="images/bass_031611.jpg" /> 2 <?php ?> 3 '' OR ''='' into my UPDATE all of it gets taken out $discrip = ($_POST ['discrip']); mysqli_real_escape_string($db, trim($discrip)); Most books I have give the example of: $discrip = mysqli_real_escape_string($db, trim($discrip)); Not mysqli_real_escape_string($db, trim($discrip)); I have php 5.3 on xampp Thanks in advance S
  13. I guess I shouldn't have used the word paragraph, I pondered what to call it for a few seconds before I posted the post. Is there anyway to indent the lines I'm talking about, if I can't indent them then I would expect that I couldn't put a space between them either. The way the (artical(?), text) looks now is all jumbled up. So can I indent them someway or is there a way I can put each string of text ending in a carriage return in html paragraph tags? Thanks again
  14. If I use margin and/or padding it will narrow the whole artical. I just need the first line of every paragraph indented. Thats why I was using text-indent. Thanks
  15. I have a string that I run through nlbr2(), nlbr() works fine but when I apply the css property text-indent it only indents the first line of text. So it looks like xxxxxxxxxxx xxxxxxxxxxxxxx (carriage return) xxxxxxxxxxxxxx xxxxxxxxxxxxxx And I want the text to look like this xxxxxxxxxxx xxxxxxxxxxxxxx (carriage return) xxxxxxxxxxx xxxxxxxxxxxxxx How do you text-indent with carriage returns ? Thanks in advance S
  16. It's Neat and tooooo funny, I saw Bay Area and thought California, then I saw the time and said to myself that's not my time and California is three hours behind me. Then I noticed the flatland in one of the pics and said yep, that's not far from here. Ditto Zurev
  17. My provider says that my display_errors is set to off ( in an email, also I have a new provider and I can't see how to get to php.ini yet) I always thought that if display_errors is set to off that when a php error would occur that the screen would go blank from that spot and beyound. However when I put in the wrong connect info by mistake I got Warning: require( PATH TO connect.php (I changed this)) [function.require]: failed to open stream: No such file or directory in /this directory (I changed this) on line 10 Should this stuff be showing with display_errors set to off ?
  18. My provider has an app on my cpanel called web disk Supposedly it's were you can see your server files(I think from your desk top) also it's suppose to make it easier to upload files. It does require an open port on your desktop. The Only review I found was on cnet and the guy saying don't have an open port on your computer stay with filezilla, web disk doesn't save that much time. Has anyone ever heard of this?
  19. Also on non-repeating rows $q = "SELECT column FROM table WHERE column = column-varaible"; $r = @mysqli_query ($dbc, $q); if (mysqli_num_rows($r) == 1) { // Has a valid column-varaible. // Get the source information: $row = mysqli_fetch_array ($r, MYSQLI_NUM); echo '<p><a href="http://'.$web_url.'">'.$web_title.'</a></p>'; Both work but I guess I have just used the first one I mentioned over time
  20. Also on the last one I limit the results with $q = "SELECT * FROM table WHERE column = column-varaible LIMIT 1";
  21. if it's 'something like this and its in repeating rows I use while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){ echo '<a href="'. $row['id_member'] .'">' . $row['name'].'</a>'; } if its not repeating rows I use while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){ $web_url = ''.$row['web_url'].''; $web_name = ''.$row['web_name'].''; } echo '<p><a href="http://'.$web_url.'">'.$web_title.'</a></p>';
×
×
  • 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.