-
Posts
24,602 -
Joined
-
Last visited
-
Days Won
830
Everything posted by Barand
-
-
Arrays from MySQL database contains no data? (Simple Q)
Barand replied to rjt90's topic in PHP Coding Help
Syntax for IN is a comma-separated list eg IN (1,2,3) It looks like your $var_hook is an array, so $id_list = join(',', $var_hook); then use IN ($id_list) -
This thread should help http://forums.phpfreaks.com/topic/277085-the-eav-model-or-something-better/
-
See forum FAQ http://forums.phpfreaks.com/index.php?showtopic=273121
-
Sean Murray has 32 yes/no values so there is not a consistent pattern edit: Also fran and roxy have single-word names
-
try echo "<option value=\"{$row['csname']}\">{$row['csname']}</option>";
-
See "MySQL Table aliases". Most of the time they are an optional convenience but in some cases they are essential.
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
Getting Error Before Installing PHP Script ( Mysql Database Connection Error )
Barand replied to Venky's topic in MySQL Help
see this site's FAQ http://forums.phpfreaks.com/index.php?showtopic=273121 -
Is there any programming standards for resizing images in PHP?
Barand replied to angel1987's topic in Application Design
The problem with resizing on the client, either HTML or CSS, is that you are still downloading the full-size image which takes time. If I'm going to require thumbnails I prefer to create them on upload then they are available for speedy download and display.- 4 replies
-
- image resize
- images
-
(and 2 more)
Tagged with:
-
To find records in votes with no matching poll_id in user_votes use a left join. SELECT v.* FROM votes v LEFT JOIN user_votes uv ON v.poll_id = uv.vote_poll_id WHERE v.user_id = 1 AND uv.vote_poll_id IS NULL
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
What gets updated when a user votes?
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
perhaps @VAL := LAST_INSERT_ID(); INSERT INTO `otherTb` (user_id, `instance_id`, `category_id`,) VALUES (@VAL, NULL, 04);
-
which of those 2 tables, votes or user_votes, does NOT have a poll_id until the user votes?
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
All 3 of them
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
1 You need all the items being voted on so you know which are missing 2. You need all users so you know who has not voted 3. You need which user voted for which item
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
To do this you need 3 tables voter : voterid | voter item : itemid | item votes : itemid | voterid Create a cartesian join between voter and item to get all combinations then left join with votes to see which combinations are missing
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
what do your tables look like?
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with:
-
Nothing changes! How are you doing?
-
my code for save mobile number doesn't work correctly
Barand replied to nekooee's topic in PHP Coding Help
As I said, it worked fine for me, but then I was using my own test data files. Attach your data files and I see if it makes a difference. -
There is an excellent class you can download called "AdLDAP". I used it all the time for AD applications
-
That final ORDER BY should be GROUP BY. Guess you spotted that.
-
try SELECT date, aname, SUM(total_leads) as total FROM ( SELECT DATE(l.time1) as date,a.affid,a.aname, COUNT(l.reqid) as total_leads FROM leads l LEFT JOIN affiliates AS a ON l.affid = a.affid LEFT JOIN campaign AS c ON l.campid = c.campid WHERE (a.affid = l.affid) GROUP BY DATE(l.time1),a.aname UNION ALL SELECT DATE(x.extstamp) as date,a.affid,a.aname, COUNT(x.reqid) as total_leads FROM ext_leads x LEFT JOIN clicks AS cl ON cl.reqid = x.reqid LEFT JOIN affiliates AS a ON a.affid = cl.affid_sid WHERE (cl.reqid = x.reqid) GROUP BY DATE(x.extstamp),a.aname ) as sub ORDER BY date, aname
-
try $db = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE); // connect to database $costSql = 'SELECT sum(amount) FROM costs'; // define the query $result = mysqli_query($db, $costSql); // execute the query $row = mysqli_fetch_row($result); // get return row $costs = $row[0]; // get the total $donationsSql = 'SELECT sum(amount) FROM donations'; // define the query $result = mysqli_query($db, $donationsSql); // execute the query $row = mysqli_fetch_row($result); // get return row $donations = $row[0]; // get the total $result = $donations - $costs;
-
Find and delete duplicates under the right condition
Barand replied to PatrickPetersen's topic in PHP Coding Help
Your example used commas as separators in the CSV, you are now using semicolons.- 19 replies
-
- csv
- dublicates
-
(and 3 more)
Tagged with:
-
Find and delete duplicates under the right condition
Barand replied to PatrickPetersen's topic in PHP Coding Help
Did you allow for mine opening "input.txt" and writing to "output.txt"?- 19 replies
-
- csv
- dublicates
-
(and 3 more)
Tagged with: