Jump to content

[SOLVED] way to work around code


contra10

Recommended Posts

is there a way to work around this code

	<?php
mysql_connect("localhost", "root", "") or die(mysql_error()); 
mysql_select_db("registration") or die(mysql_error()); 

if (isset($_POST['submit'])){

if(is_numeric($_POST['grp'])){
$id = $_POST['grp'];

$query= "SELECT * FROM groups WHERE id = $id";
$result = mysql_query($query) or die(mysql_error());;
$group = mysql_fetch_assoc($result);
$groupname = $group['name'];

$insert = "INSERT INTO groups (user) VALUES ('$username') WHERE name = '$groupname'";

$add_group = mysql_query($insert) or die(mysql_error());   
}
else {
echo $_POST['grp'] . ": Is not numeric...";
}
   
?>

I need to upload information in a specific area but i can't user the where function

Link to comment
https://forums.phpfreaks.com/topic/138362-solved-way-to-work-around-code/
Share on other sites

sry

 

k I want to input into a row of one of my tables a value but in a specific row...a row is created before and I want to know if there is a way to upload into that same row a new variable without using the UPDATE syntax

 

<?php

$insert = "INSERT INTO groups (user) VALUES ('$username') WHERE name = '$groupname'";
?>

 

like i want the username to be uploaded in a specific row

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.