Jump to content

Rommeo

Members
  • Posts

    313
  • Joined

  • Last visited

Everything posted by Rommeo

  1. Rommeo

    Query Problem

    Hey, I think it s the correct code and works well, but it gives me the result of datas where shoppingbox contains $boxitem, I want the results of datas where shoppingbox does NOT contain boxitem
  2. Rommeo

    Query Problem

    any ideas ? which keyword I need to use ?
  3. For the website I m working on one table is like : table_user usernaname | shoppingbox rommeo | 1 3 5 19 36 89...94 105 1002 julliet | 3 5 6 8 9 10 rome | 8 9 10 I want to list the users whose shoppingbox does not contain "1", I m stuck about the query since it does not contain just one value. $boxitem = 1; $query = "SELECT * FROM table_user WHERE shoppingbox != $boxitem"; This query would not work I guess, ( I m aware of the problem about the design of the table, But I must use this way )
  4. I have two laptops, and I m connecting internet via cable at work. ( by DHCP ), so I when I plug the cable the server assigns the IP for my laptop. But sometimes I need to work with my other laptop and I need internet connection for it too, then everytime I m plugging the cable to the computer I need to work with and transfering files between two computers is another problem. As a result I have one cable with internet ( by DHCP ). and I have two laptops, how can I connect these two computers to each other so that I can connect to internet by two of them and transfer files between each other ? Which device I need ? I have 4 port switch was working well while I was using ADSL modem and switch together so I was able to connect the computers to each other, but in my new office, cable with DHCP on, I m not able to use it anymore, it does not work..
  5. if my table does not have default or null values ? what kind of problem would I face ?
  6. Let's say my user_table has following fields; username name surname country but I'm just inserting to one field and skipping the rest: $query = "insert into user_table ( username ) VALUES ( $username) "; mysql_query($query); Does inserting data like this cause any unwanted problems ?
  7. Thank you so much for your comments!
  8. I ll put watermark to the photos of my website and I have two options : 1-) I may put watermark while uploading the image. And watermark will be applied to the original image and can not remove it. 2-) I may put watermark while showing the image, the original image will not be affected and I ll keep it as it is in the folder, just while showing watermarked image will be created ( watermark.png will be applied by the function) so according to your experiments, which one would you go with ? for first one, I m thinking about a solution if I want to change the logo of the website, then some of the images will have an old logo. for second one, I m wondering if the website will slow down, since it will create the same image again and again whenever you click the image..
  9. but there will be thousands of users+visitors(not member) and photos, in that table there will be millions of rows (combination) visitedphotosTable userid | photoid 3 -------- 5 3 -------- 6 2 -------- 5 . . . I think there will be a delay while processing the query, wont there ?
  10. For members; there will be thousands of photos, and thousands of members so there will be millions of rows ( combination table of userid and photoid) , by a select query and taking the ids, and another select query for taking except those ids ( to print non visited photos ), will not it take time processing the query ?
  11. I have some thousands of photos about nature I ll let visitors/members to see them one by one, but I dont want to show them the same photo again after they visit 1 week later How can I do this ? What I think as a solution is; For members; I can store the ids (like "everest01") of the photos that member has visited , and show user the most visited photos that he/she has not see for next visit. But what I m wondering is, how will I take the photos from DB ? select * from photos WHERE id not in ( $thousandsofvisitedphotoids ) ?? I m stuck here ? For visitors ( not members ) ; I can set a cookie that keeps the ids of visited photos.. when visitor visits the website again, I take the cookie and sent to $thousandsofvisitedphotoids and make a query again ? I m stuck here, How you guys do this ? what's the logic of this ?
  12. By the default language, I mean the language that was set if the user did not select any language. session[language] takes the language from the cookies.if the cookie was not set by any language, session automatically uses the default language. What I mean is I m using same structure for my other website and my pages are already indexed by google bot with the default language like mysite.com/posts/21 so does it make any difference if I change the link structure ? and do it like: mywebsite.com/en/posts/21 mywebsite.com/fr/posts/21
  13. I m building a multi-language website. For my website to be number 1 in search results, which way should I use about getting the language ? 1) mywebsite.com/english/posts/21 goes to post that's id is 21 and prints the post in english the language selection was taken from the link 2)mywebsite.com/posts/21 same as before, prints the post that's id is 21 the language selection was taken from the cookie that was set by the visitor before so for first case, google will list same post with different address mywebsite.com/english/posts/21 mywebsite.com/french/posts/21 for second case, it s gonna be listed one time with the default language mywebsite.com/posts/21 for the post number 21, which way is better and the link will be the number 1 in search results ?
  14. my tables are like : tablePost id | content | categoryid 7 |hello woo| 5 8 |woot woo| 5 tableCategory id| catname 5 | random 6 | favorites I want to print all posts with the names of the categories they belong to, example result : random : 7 hello woo random : 8 woot woo I tried this : select * from tablepost where categoryid = ( select id from tablecategory ) order by id desc; I m sure this is all wrong since it did not work, I m not good at queries, can someone help me to figure this out ?
  15. lets say my website has a directory "photos" it has me.jpg family.jpg pet.jpg I m using this photos in "aboutme.php" But the problem is, when I enter www.mysite.com/photos/ it automatically list all the photos that I m using in whole website. How to prevent this ? Any solution is ok, just thought it can be solved via mod_rewrite
  16. // create short variable names $name=$_POST['name']; $age=$_POST['age']; $height=$_POST['height']; $hair=$_POST['hair']; $measurements=$_POST['measurements']; $weight=$_POST['weight']; $eyes=$_POST['eyes']; $service=$_POST['service']; $nationality=$_POST['nationality']; $location=$_POST['location']; $city_1=$_POST['city_1']; $city_2=$_POST['city_2']; $city_3=$_POST['city_3']; $city_4=$_POST['city_4']; $phone=$_POST['phone']; $email_1=$_POST['email_1']; $email_2=$_POST['email_2']; $website=$_POST['website']; $description=$_POST['description']; $availability=$_POST['availability']; $thumbnail=$_POST['thumbnail']; $url=$_POST['url']; $status=$_POST['status']; $views=$_POST['views']; $expiry_date=$_POST['expiry_date']; $notes=$_POST['notes']; echo $notes; instead, you just write extract($_POST); echo $notes; Same thing.
  17. Did you create a DB and set the values ? added the user ? or is that a test server that you can use empty values ? Generally by default host is "localhost" and you set the rest.
  18. You are not using password, or your password is wrong as it says.
  19. my mistake, it has to be mysql_query, not the result. $result = mysql_query( $query ) or die ( mysql_error() ) ;
  20. $query = "insert into model (model_name, age, height, hair, measurements, weight, eyes, service, nationality, location, city_1, city_2, city_3, city_4, phone, email_1, email_2, website, description, schedule, thumbnail, url, status, views, expiry_date, notes) values ('$name', '$age', '$height', '$hair', '$measurements', '$weight', '$eyes', '$service', '$nationality', '$location', '$city_1', '$city_2', '$city_3', '$city_4', '$phone', '$email_1', '$email_2', '$website', '$description', '$availability', '$thumbnail', '$url', '$status', '$views', '$expiry_date', '$notes')"; after these, write these : $result = mysql_result ( $query ) or die ( mysql_error() ) ; now it will tell you what the problem is, copy it here if you can not figure it out.
  21. For to create short variables, you may write extract($_POST), you dont need to write that long. and for insert query : "insert into model (dbfieldage, dbfieldname, ) values ( '$postedage', ... ) "
  22. Exacty, I just mean that, how can I take the results that are before the correct result and print them ? I need two queries ? or is there a keyword/function for to do that ?
  23. but utf8_unicode_ci is the correct charset for my needs. even those chars are like that in the db, I dont have even one problem while printing them. As I said just the searching function does not work. I tried others, whenever french chars are working, cannot print greek chars then. now both working right, unfortunately I have no other option about charset.
  24. The thing I have noticed is that ; the data in DB is like : facileæ it prints right when I search for "facile" but most prob can not find when I search for "facileæ" cause of "æ" needs to be converted to æ How can I convert it ? I tried the query by phpmyadmin where user like %facil% and result : facileæ the
×
×
  • 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.