
jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
Double check the script of this file and make sure that this constant is difened! <?php /** * These are the database login details */ define("HOST", "localhost"); // The host you want to connect to. define("USER", "sec_user"); // The database username. define("PASSWORD", "4Fa98xkHVd2XmnfK"); // The database password. define("DATABASE", "secure_login"); // The database name. define("CAN_REGISTER", "any"); define("DEFAULT_ROLE", "member"); define("SECURE", FALSE); // FOR DEVELOPMENT ONLY!!!!
-
You shoud get some error messages without them I am affraid we cannot help you.Try to add the following error_reporting functions on the top of the file you call. ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1);
-
You should get an error message if you're trying to post a huge script. If so, you need to post only that piece(s) of code that relevant to your actual problem.
-
Post all relevant code here using forum's code tags and don't attach files when providing code, some users like me do not like the idea to download files into their own macines.
-
How do you debug php? Which debugger do you use?
jazzman1 replied to renatov's topic in Editor Help (PhpStorm, VS Code, etc)
B/s the main purpose of using XDebug is to brake down your script into small pieces and fragments of data making it much more easy to debuging. By using OO design patterns, that's guarantee (in most cases) that, that data it's encapsulating within a set of functions designed to ensure that the scripts are used appropriately and in a human readable format. -
How do you debug php? Which debugger do you use?
jazzman1 replied to renatov's topic in Editor Help (PhpStorm, VS Code, etc)
I find XDebug as not very efficient for myself when I follow object oriented design patterns in my code. It could be very powerful and useful if you're coding in procedural way with bad coding design. I am on Netbeans IDE which is absolutely enough for what I want to do and Vi/VIM as command line interface code editor. -
Amend tbl_name.date_record >= current_date() - interval 1 day
-
To retrieve all records made per day based on the username, the query would be similar to this: select * from db_name.tbl_name where (tbl_name.date_record >= current_date() - 1 day) and tbl_name.user_name = 'some username' Then, use mysql_num_rows() and count how many rows this particular user already had .
-
Why? According the screenshot I see 7 returned rows for each group of ID. So, the result of using mysql_num_rows should be only 1 for each of them. He could get the result of klikovi (clicks) to compare how many clicks already had for this particular group of IDs.
-
I'm not really sure from where to start but, I do believe you should have to learn the basics of SQL and PHP. Also, as Psyco said above, when you ask for a free-paid help, you must provide all relevant information to help us help you. Not to mention that you have searched for a solution to your problem before asking it, haven't you? However, if you're trying to communicate on an English-language forum, you owe it to yourself to make an effort to write/describe the context and comments of your code at least reasonably correct English. I am Bulgarian and understand when reading Serbian language but most of the "staff" and members here do not so, they don't pay attention about your posting just scrool down the page in fine it's absolutely unuseful for anybody here. I dislike when people posting links out, for instance how to ask questions in a smart way or something similar, but do some google research and maybe you'll find some useful article for you. So, to answer your question, first, you need to define and explain in English what your intent is! If I understand correctly ( correct me if I am wrong), you have a website, where the members post links, text, pictures or something else. So, you want to restrict postings in time one per day (24 hours) for those members having postings less than 3. For those ones which already had more than 3 this restriction shouldn't work, right? Or...a second scenario. All users can make postings but only those who already had 3 clicks (as "like", "good", "yes" or something else) in their profile only they would be able to make posting more than 1 post per day. Can you explain that in a better way? Could you also explain the logic of this UPDATE statement too -> "UPDATE clanovi_njihovi_racuni SET klikovi = klikovi-0 WHERE id='$racun'"; especially the part of a SET statement - klikovi = klikovi-0. How is data represented in "klikovi" column as 0 (zero) and 1 (one) for click, or...? Why the foreign key named "racuni" is on type varchar in case, it links to PK of int type column? And finally if every click is represented as integer (0 and 1) in its column, you can simply summarize them using a sql sum() function, join both tables on "racuni" key, group them by user_ID and use the logic provided by kicken.
-
So, this query SELECT cnr.klikovi, COUNT(cnr.id) AS post_count FROM clanovi_njihovi_racuni AS cnr LEFT JOIN clanovi_njihovi_parovi AS cnp ON cnr.id = cnp.racun AND cnp.datum=curdate() WHERE cnr.id='$racun' GROUP BY cnr.id does not give you an answer of Why are you using fields of type varchar to store the date and datetime value? This insert statement should be inserted null values using mysql datatime functions on columns with type different from date and datetime. $query = "INSERT INTO clanovi_njihovi_parovi SET racun='$racun', ip='$ip', datum=curdate(), vrijeme=curtime(), tim1='$tim1', tim2='$tim2', tip='$tip', kvota='$kvota',link='$link'"; According screenshots "datum" and "vrijeme" are on varchar type in your table. You left too much mess here
-
Ok, step by step, are you done with that? P.S If your answer is yes, show us the script.
-
What happens with the last select statement? Is there an id = 1? Post the result of select * from clanovi_njihovi_racuni where 1;
-
Can I see the results of DESCRIBE clanovi_njihovi_racuni; and DESCRIBE clanovi_njihovi_parovi; SELECT * from clanovi_njihovi_racuni where id = 1 Assuming the "id" with value 1 exists in this column.
-
Open up your GUI sql tool and run your sql code without any php itself. Example: SELECT cnr.klikovi, COUNT(cnr.id) AS post_count FROM clanovi_njihovi_racuni AS cnr LEFT JOIN clanovi_njihovi_parovi AS cnp ON cnr.id = cnp.racun AND cnp.datum=curdate() WHERE cnr.id='$racun' GROUP BY cnr.id EDIT: Replace '$racun' variable with an integer static value like 1, 2 or whatever you're expecting to be.
-
Yeap, it's a Serbian language. There is no Bosnian or Macedonian languages So, what result you're getting running the query via phpMyAdmin, MySQL Workbench or other visual sql tool for mysql?
-
I'm not sure whether you would be able to achive that in case this VM is a part of the same windows instalation. What's the problem with the bootable linux cd? Another good alternative is Hirens.BootCD.
-
Download any linux life cd distro, boot Linux from the CD, mount the NTFS windows partion, find the directory and delete the file or delete all windows if you prefer
-
He-he, Tony thank you for sharing the link to Silex I've installed Silex few days ago by Composer and i was very impressed how easy and fast I've done everything on my RedHat server I've noticed that Silex is not a real MVC framework like CakePHP, Symfony,Zend, etc...but....for small projects that is very useful, b/s we don't need to use a full functionality of MVC. It gives me only the C (controller) of the MVC pattern for V (view) I can use a "twig" or a flat php and for M (model) I could use a doctrine ORM, if I want it.
- 8 replies
-
- framework
- micro-framework
-
(and 1 more)
Tagged with:
-
I don't know why you cannot retrieve the content from multiple tables and databases. Unfortunately, there is no way to test it how this wonderful program works in windows ( I have only windows 95) See my log, the last time that I restarted the mysql-workbench was at March 28. Log: [jazzman@localhost log]$ ps aux | grep /usr/bin/mysql-workbench jazzman 31356 0.0 0.0 106096 1276 ? Sl Mar28 63:27 /bin/bash /usr/bin/mysql-workbench jazzman 32504 0.0 0.0 103244 844 pts/0 S+ 12:57 0:00 grep /usr/bin/mysql-workbench
-
Hm..... that's very weird. I've never have a problem with it for one year on my CentOS6.x (Gnome) machine. I thing that problem appears because of yours linux graphical environment.