Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
[SOLVED] Probably simple yet annoying query problem
Daniel0 replied to Dargrotek's topic in MySQL Help
What happens when you just do SELECT * FROM user_registration_details WHERE username = 'testaccount'; ? -
[SOLVED] Probably simple yet annoying query problem
Daniel0 replied to Dargrotek's topic in MySQL Help
Try this: SELECT rd.id, COUNT(mb.id) FROM user_registration_details AS rd INNER JOIN user_mail_blist AS mb ON mb.user_id = rd.id AND mb.save_id = 1 WHERE rd.username = 'testaccount'; -
Yeah. Do you have some sort of control panel you are managing your MySQL server with, or are you using the CLI console?
-
They are used when something "exceptional" occurs, so to speak. E.g. if (!$item = $model->getById($_GET['id'])) { throw new DomainException('Item not found.'); } if (1 > $_GET['page'] || $_GET['page'] > $numPages) { throw new OutOfRangeException('Invalid page number.'); }
-
You can use DirectoryIterator to scan the folder for items. You can use functions like readfile or file_get_contents to read them. You can use GD to manipulate the images. I suppose you'll have to be more specific to get more help.
-
No, yours is better. samshel's will not complete the remainder of items in the loop if the first email is sent.
-
What do you need to search for?
-
Seems like the mysqli extension in PHP has been disabled. You might want to contact your host about that.
-
Your username and/or password is wrong or that particular user is not allowed to login from the server where your script is.
-
That link isn't even valid in SMF. Where did you get that link?
-
Try to run the query directly on the db instead.
-
There are other reasons why SMF would be difficult to dive into...
-
Which particular script would that be?
-
In web design it usually refers to the deprecated practice of having a 1x1px transparent gif and then using the height and width attributes on the img tag to push things downwards or to the side.
-
The Little Guy... must be midget porn then.
-
It doesn't look like you have a foreign key on gtown_eticket for gtown_event. If we say that you have a field in that table called events_id that links etickets to events then you can run a query like this: SELECT SUM( SELECT SUM(qty_ticket) FROM gtown_eticket AS t INNER JOIN gtown_events AS e ON t.events_id=e.events_id GROUP BY e.eticket_id ) AS tickets_sold FROM gtown_events WHERE events_id = 123; I haven't tested it, but I think it should work. It'll get you the amount of tickets sold for a particular event. Then you just have to check that it doesn't exceed the allowed amount using a simple conditional.
-
Something that adds space between two elements. You could call it a separator as well.
-
[SOLVED] Search DB by Firstname AND/OR Surname
Daniel0 replied to mikebyrne's topic in PHP Coding Help
You obviously still need to actually execute the query and fetch the rows from the result like you did in your first code snippet. -
Yeah. Jeff did the layout, I did the programming.
-
[SOLVED] Search DB by Firstname AND/OR Surname
Daniel0 replied to mikebyrne's topic in PHP Coding Help
Right, just remove that entire line. -
[SOLVED] Search DB by Firstname AND/OR Surname
Daniel0 replied to mikebyrne's topic in PHP Coding Help
Well, ok. You can just remove my else block. -
Don't.
-
[SOLVED] Search DB by Firstname AND/OR Surname
Daniel0 replied to mikebyrne's topic in PHP Coding Help
$sql = 'Select `Fname`,`Sname`, `Address1`, `Address2`, `Address3`, `Address4` FROM `Athy` WHERE '; if ($Fname && !$Sname) { $sql .= "`Fname` = '" . mysql_real_escape_string($Fname) . "'"; } else if (!$Fname && $Sname) { $sql .= "`Sname` = '" . mysql_real_escape_string($Sname) . "'"; } else if ($Fname && $Sname) { $sql .= "`Fname` = '" . mysql_real_escape_string($Fname) . "' OR `Sname` = '" . mysql_real_escape_string($Sname) . "'"; } else { throw Exception('Both first name and last name are empty.'); } You need to escape your values or bad things will happen. -
ip should be an unsigned integer (use MySQL functions INET_ATON() and INET_NTOA(), or PHP functions ip2long and long2ip). visit_date should be DATE or DATETIME. All of those TEXTs would be better off as VARCHARs. referrer should not be set to NOT NULL seeing as it might be the case that there is no referrer, in which case NULL would be the most appropriate value. Also, you'll not be able to track the referrer using that gif.
-
Instruct Google to not index print-only pages
Daniel0 replied to TheFilmGod's topic in Miscellaneous
robots.txt or perhaps nofollow.