
john010117
-
Posts
492 -
Joined
-
Last visited
Never
Posts posted by john010117
-
-
-
Yes, there is a way. First, name all of your image files the same way (ex: LANGflag.gif) and they should all be in the same folder. Then when you display it, just use
<?php $lang = $_GET['lang'] // (or however you get your user's language) echo '<img src="/images/' . $lang . 'flag.gif">'; ?>
-
Heh, I'd look into phpBB's lang source code. They have it in arrays, but you'll have to download additional language packs.
-
Did you put session_start() at the very beginning of both files?
-
<?php $idr = $_GET['idr']; $table = $_GET['table']; echo '<a href="printquote.php?idr=' . $idr . '&table=' . $table . '">link</a>'; ?>
-
First of all, I suggest you put session_start() at the beginning of login.php. Then, in logout.php, you have to start the session first, then destroy it.
-
Yes, it's a $_GET[''] function.
<?php $idr = $_GET['idr']; $table = $_GET['table']; echo '<a href="printquote.php?idr=' . $idr . '&table=' . $table . ">link</a>'; ?>
-
$query = "SELECT rank FROM `ranks` WHERE id IN(" . implode(',', $rankid) . ")"; $result = mysql_query($query) OR DIE (mysql_error());
Putting it in variables is sometimes easier.
-
It'll be better if you posted the relevant part(s) of the code here, as I am not going to click those links. However, have you looked at array_merge() ?
-
Try this:
$result = mysql_query("SELECT rank FROM `ranks` WHERE id IN (" . implode (',',$rankid) . ")");
-
What exactly were the errors that you got?
-
We're here to help, not to make the entire thing for you. Try to get started on it first, and we'll be glad to help you along the way.
-
Put
<?php error_reporting(E_ALL); ?>
at the very top of the page. See if any error message comes up.
-
That worked!
Thank you all so much for helping me out with this.
-
I don't really get what you mean by the question, but the field "msg_id" is the same in both tables.
I'll try that out.
-
Nevermind. You started the session already ($_SESSION['username'] = $username). I overlooked that before. Sorry.
Solution:
check_login.php:
<?php session_start(); mysql_connect("localhost", "root", "xxxxxxxx"); mysql_select_db("xxxxxxxxxxxx"); $username = $_POST['username']; $password = $_POST['password']; $sql = "SELECT * FROM users WHERE username = '$username' AND password = '$password'"; $result = mysql_query($sql); if (mysql_num_rows($result) == 0) { echo "Username and password combination not found."; } else { while($row = mysql_fetch_array($result)) { $_SESSION['username'] = $row['username']; } header("members.php"); } ?>
-
try to change this to
DELETE FROM table_name
WHERE column_name = some_value
Since I'm dealing with multiple tables, that wouldn't work.
-
You didn't start $_SESSION['username'] in check_login.php...
-
That just deletes ALL of the records. I believe I need the limit in there.
-
Echo the SQL query and paste it here.
DELETE privmsgs, privmsgs_spec FROM privmsgs, privmsgs_spec WHERE privmsgs.msg_id IN (4,5) LIMIT 2
-
File 1:
<?php // Blah Blah include ('file2.php'); ?>
File 2: (the include file)
<?php echo '<td></td>'; echo '<td>'; ?>
You don't really have to use PHP in the include file...
<td></td> <td>
-
@ roopurt18:
I got this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 2' at line 8My query now looks like this:
<?php $query = "DELETE $privmsgs_tbl_name, $privmsgs_spec_tbl_name FROM $privmsgs_tbl_name, $privmsgs_spec_tbl_name WHERE $privmsgs_tbl_name.msg_id IN (" . implode(', ', $_POST['pm_delete']) . ") LIMIT " . count($_POST['pm_delete']); ?>
Any ideas?
@ Hypnos: I'll try it out.
-
Try $_POST['check']['1']
or maybe
$_POST['check'][1]
-
Will this work with deleting rows from multiple tables that I have now? They all have the same ID as their common row.
How to display a certain image, depending on a variable.
in PHP Coding Help
Posted
Ok, then. So first, get the data from the database. Then, using the code I've posted above...