172 Posted Topics

Member Avatar for Nsie
Member Avatar for kjeu_kach
Member Avatar for Szabi Zsoldos
0
198
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for maniat123
1
229
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for Szabi Zsoldos
0
134
Member Avatar for PF2G

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

Member Avatar for PF2G
0
162
Member Avatar for daniel36
Member Avatar for Szabi Zsoldos

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']; …

Member Avatar for Szabi Zsoldos
0
264
Member Avatar for rotten69

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 …

Member Avatar for rotten69
0
184
Member Avatar for Szabi Zsoldos

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 &raquo; </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 …

Member Avatar for Stefano Mtangoo
0
202
Member Avatar for ON_Jtharpe

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) …

Member Avatar for codewall
0
152
Member Avatar for burningcandle10

Actually what you need is a simple database with a table in it, or two, and fetch the data with some simple querys.

Member Avatar for Szabi Zsoldos
0
167
Member Avatar for mtvaran

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 …

Member Avatar for mtvaran
0
88
Member Avatar for ahmedeqbal

You can update all directly from MySQL [CODE] mysql -> UPDATE yourTable SET ON yourField='newLink' WHERE yourField='oldLink' [/CODE]

Member Avatar for richieking
0
91
Member Avatar for rajeesh_rsn

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]

Member Avatar for krishx343
0
260
Member Avatar for Szabi Zsoldos

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 …

0
116
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for urtrivedi
0
84
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for Szabi Zsoldos
0
148
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for Szabi Zsoldos
0
146
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for jonsca
1
375
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for Szabi Zsoldos
0
561
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for WaltP
0
72
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for Szabi Zsoldos
0
108

The End.