172 Posted Topics
Re: Could you post part of your code so we can help you ? | |
Re: I don't actually understand your question. What do you need it for ? | |
Hello, I've built a timekeeping aplication from a fingerprint machine with automatic import to db and I'm getting some reports. One report is that I'm getting the employees time if they are late from work. But my table is small with 20.000 entries, but with the following query, the results … | |
Hi guys, Working on a table. Each of the entries has an A or B in the 'tip' field. I order them by 'tip' how can i add a special row for the first entry of the A or B series from the query? I know it's not an IF … | |
Re: First of all you should do a JavaScript with return false; for not letting the script to go further. You should do a verification by PHP as well | |
Re: Well this is a class, you should see what functions it has. | |
Hey guys, I'm working on a ajax drop down system. I'm currently finding myself in a difficulty with a $_POST[]. The thing is that I want to explode my $_POST but it doesn't let me for something, cant find it out why. [CODE] case 2: if(strstr($_POST['modelBox'],'^')) { $ex = $_POST['modelBox']; … | |
Re: Here is the result that you need. [CODE] for(i = 1; i <= 5; i++) { for(j = 1; j <= 5; j++) { System.out.println(j); if(j == 5) { System.out.println("Loop terminated at " + i); } } } [/CODE] [ICODE] 1 2 3 4 5 Loop terminated at 1 1 … | |
Hello, I have this weird issue with my simple upload form for different files. [CODE] <form enctype="multipart/form-data" action="mesaje_furnizori.php" method="GET"> <table> <tr><td align="right">Va rugam selectati » </td><td><?php echo $selectare; ?></td></tr> <tr><td align="right"><td><input type="file" name="file" id="file"/></td></tr> <tr><td align="right" colspan="2">Fisiere suportate (.*gif,*.jpg,.*jpeg,.*png,.*bmp,.*doc,.*docx,.*xls,.*xlsx) Marimea maxima de: <strong>5MB</strong></td></tr> <tr><td colspan="2"><textarea name="mesajTrimis" cols="70" rows="15"></textarea></td></tr> </table> <input … | |
Re: You could use just the simple mysql_num_rows, so if you get a record that equals your form input, then it redirects you to your desired page, else, it will display a message. [CODE] <?php if(isset($_REQUEST['login'])) { $query = "SELECT user, pass FROM yourTable WHERE user='".mysql_real_escape_string($_REQUEST['user'])."'"; $result = mysql_query($query); if (mysql_num_rows($result)>0) … | |
Re: Actually what you need is a simple database with a table in it, or two, and fetch the data with some simple querys. | |
Re: Simply you can do this with a simple if/elseif/else statement. You just have to play with your variables and with your database fields. [CODE] <?php if (isset($_REQUEST['yourColumnValue1']) && $_REQUEST['yourColumnValue1']) { $q = mysql_query("SELECT * FROM yourTable WHERE yourField LIKE '%".mysql_real_escape_string($_REQUEST['SearchValue'])."%' || yourField2 = '".mysql_real_escape_string($_REQUEST['SearchValue'])."' ORDER BY x, y"); } elseif … | |
Re: You can update all directly from MySQL [CODE] mysql -> UPDATE yourTable SET ON yourField='newLink' WHERE yourField='oldLink' [/CODE] | |
Re: No tested, but something like this. [CODE] <?php $now = NOW(); // fetch the date from the database $yourTimeVariable = date("Y-M-D-H:m",strtotime("+1 day")); if (($_SERVER['REMOTE_ADDR'] == $yourDatabaseIP) && ($now == $yourTimeVariable)) { echo 'You have already voted, please come back in 24h.'; } else { // voting script } ?> [/CODE] | |
Hello, What I'm intending to do it's an Organization chart with departments and members. Basically an organigram with different departments and different members. This is the MySQL database. And here is my attempt of doing this horizontally, but i`m kind of stuck. Could you give me some hints on how … | |
here I have [CODE] //functions.php <?php session_start(); function loggedin(){ if(@$_SESSION['username']){ @$username = $_SESSION['username']; return true; } elseif(@$_COOKIE['username']) { @$username = $_COOKIE['username']; return true; }else { return false; } } function getuid($username) { $res = mysql_query("SELECT id FROM users WHERE username='$username'"); if(mysql_num_rows($res)) { $row = mysql_fetch_assoc($res); return $row['id']; } } function … | |
Hey guys, Could you help me understand how to implement [CODE]mysql_real_escape_string[/CODE] to prevent injection in this code ? [CODE] <?php if(loggedin()){ echo "You are already logged in."; } else { if($_POST['submit']){ if($_POST['username'] && $_POST['password']) { $username = $_POST['username']; $password = $_POST['password']; $password = md5($password); $res = mysql_query("SELECT * FROM users … | |
Hey guys, I know that the query is not good, but i CANT see the problem. Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\XAMPP\xampp\htdocs\betania\modify.php on line 8 Could you please help me out? [CODE] <?php include "connection.php"; if(!isset($_POST[submit])) { $q = mysql_query("SELECT * FROM inscrieri WHERE … | |
Hey, this is my first post here, glad to be here and learn from you guys! what i'm trying to do is this: I would like to enter 2 names and then hit a number from lets say 1 to 10, and i have the array Q1,Q2... etc. these should … | |
I would like that case 1: should display how many elements do i want, and that i can assign values to those elements. Mine because of the j++ goes infinite, so i can enter infinite values to infinite arrays. How could i do this? Cate elemente vrei sa adaugi: 3 … | |
My question is the following, i'm just figuring out this language, now my question is about the "n" number. What is the role of n<5, i know after this condition it continues the for or not. But i can't find the precise explanation of the "n" . Thank you. Why … | |
Hi, this is my first post here, I would like to create x fields with name email age sex and the subscribe question, this is just an example page. If i would select the number 5,4, or any number then i would like to see 5 fields with names and … |
The End.