Home | Community | Message Board


This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Kraken Kratom Shop: Red Vein Kratom

Jump to first unread post Pages: < Back | 1 | 2 | 3  [ show all ]
OfflineGypsy Boy
Redeemer
Male


Registered: 03/17/17
Posts: 4,501
Loc: Deep in the discoteka
Last seen: 2 months, 24 days
Re: Please help me with my website [Re: Gypsy Boy]
    #26662099 - 05/10/20 10:43 AM (3 years, 8 months ago)

Quote:

But what is "SELECT post_id FROM posts WHERE EXISTS(SELECT * FROM posts)" trying to do?!




Its really neat and simple! :wink:

In my case it simply printing post_id from rows that exist!


--------------------





Extras: Filter Print Post Top
OfflineGypsy Boy
Redeemer
Male


Registered: 03/17/17
Posts: 4,501
Loc: Deep in the discoteka
Last seen: 2 months, 24 days
Re: Please help me with my website [Re: Gypsy Boy]
    #26662101 - 05/10/20 10:44 AM (3 years, 8 months ago)

Quote:

The while loop will keep loading $row until $result is expended.




This was my biggest obstacle. Coudlnt quite brainstorm the idea behind this


--------------------





Extras: Filter Print Post Top
Offlinesinglet_oxygen
Stranger
Registered: 05/10/20
Posts: 32
Last seen: 3 years, 6 months
Re: Please help me with my website [Re: Gypsy Boy]
    #26662107 - 05/10/20 10:50 AM (3 years, 8 months ago)

Quote:

Gypsy Boy said:
Quote:

But what is "SELECT post_id FROM posts WHERE EXISTS(SELECT * FROM posts)" trying to do?!




Its really neat and simple! :wink:

In my case it simply printing post_id from rows that exist!




Why wouldn't "SELECT post_id FROM posts" work? (Hint: it absolutely will work!)


--------------------
1O2


Extras: Filter Print Post Top
OfflineGypsy Boy
Redeemer
Male


Registered: 03/17/17
Posts: 4,501
Loc: Deep in the discoteka
Last seen: 2 months, 24 days
Re: Please help me with my website [Re: Gypsy Boy]
    #26662119 - 05/10/20 10:53 AM (3 years, 8 months ago)

THIS

Quote:

$sql = ("SELECT post_id FROM posts WHERE EXISTS (SELECT * FROM posts)");
$res = mysqli_query($dbc, $sql);



 
  while($row = $res->fetch_assoc())

{
 

  $id = $row['post_id'];





Is the brain power behind my program and it was doing my head in for the last 24 hours.

Finally works but i dont understand still how exactly it functions.

$res fetches a number of rows in database :

post_id = 12
post_id = 15
post_id = 20

How you work with them 1 by 1 is still not clear

Quote:

The while loop will keep loading $row until $result is expended.




Something to do with that. Every time loop is carried out it displays next mesage.

In C++ that wouldnt work. In C++ you would have to write a loop with a counter...


--------------------





Edited by Gypsy Boy (05/10/20 11:00 AM)


Extras: Filter Print Post Top
OfflineGypsy Boy
Redeemer
Male


Registered: 03/17/17
Posts: 4,501
Loc: Deep in the discoteka
Last seen: 2 months, 24 days
Re: Please help me with my website [Re: singlet_oxygen]
    #26662121 - 05/10/20 10:54 AM (3 years, 8 months ago)

Quote:

singlet_oxygen said:
Quote:

Gypsy Boy said:
Quote:

But what is "SELECT post_id FROM posts WHERE EXISTS(SELECT * FROM posts)" trying to do?!




Its really neat and simple! :wink:

In my case it simply printing post_id from rows that exist!




Why wouldn't "SELECT post_id FROM posts" work? (Hint: it absolutely will work!)





You need to read all thread buddy, i explain how post_id is not consistent. Read the thread i explained it there


--------------------





Edited by Gypsy Boy (05/10/20 11:07 AM)


Extras: Filter Print Post Top
OfflineGypsy Boy
Redeemer
Male


Registered: 03/17/17
Posts: 4,501
Loc: Deep in the discoteka
Last seen: 2 months, 24 days
Re: Please help me with my website [Re: Gypsy Boy]
    #26662136 - 05/10/20 11:02 AM (3 years, 8 months ago)

Anyway it is time to get drunk and celebrate!!

All the hard work is now history.


--------------------





Extras: Filter Print Post Top
Offlinesinglet_oxygen
Stranger
Registered: 05/10/20
Posts: 32
Last seen: 3 years, 6 months
Re: Please help me with my website [Re: Gypsy Boy]
    #26662137 - 05/10/20 11:03 AM (3 years, 8 months ago)

I looked through the thread and nothing explains why you need that clause.
"EXISTS(SELECT * FROM posts)" is always true so long as you have a single row in the 'posts' table.

You must have really fucked up your code to need it. I'd encourage you to work out how to fix your code so you don't need it (probably as simple as a "if($res = query())" pattern).

It's up to you of course.


--------------------
1O2


Extras: Filter Print Post Top
OfflineGypsy Boy
Redeemer
Male


Registered: 03/17/17
Posts: 4,501
Loc: Deep in the discoteka
Last seen: 2 months, 24 days
Re: Please help me with my website [Re: singlet_oxygen]
    #26662144 - 05/10/20 11:05 AM (3 years, 8 months ago)

Ohh shit u might be right!

:haha:


--------------------





Extras: Filter Print Post Top
Jump to top Pages: < Back | 1 | 2 | 3  [ show all ]

Kraken Kratom Shop: Red Vein Kratom


Similar ThreadsPosterViewsRepliesLast post
* Why is the text on some websites so SMALL!?! SillyWilly 925 8 10/27/04 05:22 PM
by MarioNett
* Post deleted by Administrator
( 1 2 3 all )
Alien 8,905 51 11/12/02 04:21 PM
by Anonymous
* building a website LethalX5 741 7 03/17/05 04:00 AM
by phishman
* something to hide website names? gdman 1,094 10 07/29/03 12:32 AM
by matts
* Buying domain names; owning a website 3eyes 616 3 11/22/04 09:02 PM
by AhronZombi
* question about my website and search engines stefan 569 3 01/25/05 01:39 PM
by stefan
* Nothing exists MushyMay 1,206 8 03/11/03 10:23 AM
by iconoclast
* hosting a website
( 1 2 all )
funkymonk 2,512 23 03/19/05 08:08 PM
by kadakuda

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: trendal, automan, Northerner
1,454 topic views. 0 members, 0 guests and 2 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.026 seconds spending 0.007 seconds on 15 queries.